Sometimes we save/read AutofillProfile::use_date in seconds, sometimes in microseconds. https://codesearch.chromium.org/chromium/src/components/autofill/core/browser/webdata/autofill_table.cc?q=use_date&sq=package:chromium&dr=C&l=1431 https://codesearch.chromium.org/chromium/src/components/autofill/core/browser/webdata/autofill_table.cc?q=use_date&sq=package:chromium&dr=C&l=98 https://codesearch.chromium.org/chromium/src/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc?q=use_date&sq=package:chromium&dr=C&l=431 https://codesearch.chromium.org/chromium/src/components/autofill/core/browser/webdata/autofill_wallet_metadata_sync_bridge.cc?q=use_date&sq=package:chromium&l=110&dr=C https://codesearch.chromium.org/chromium/src/components/autofill/core/browser/autofill_profile_sync_util.cc?q=use_date&sq=package:chromium&l=48&dr=C One place where this causes a problem is when using AutofillProfile::EqualsForSyncPurposes. For the same profiles the function may return false, because when writing in the DB, we discard the microseconds. There could be two possible solutions: 1. In AutofillProfile, when checking for the equality of use_date between two profiles, discard the microseconds. 2. Have all the instances of use_date in seconds (as in proto, database, .. ). This is more challenging, as the users already have data synced in a certain unit.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b70dc4c12e5befdbe56883cb58ca5c6151fd6171 commit b70dc4c12e5befdbe56883cb58ca5c6151fd6171 Author: Parastoo Geranmayeh <parastoog@google.com> Date: Tue Jan 22 15:06:26 2019 [AF] Profile time precision consistency Interacting with database/sync converts dates between time_t/Time. That causes some inconsistencies. Solution: when comparing two profiles' use_dates discard the microsecnods. Bug: 923965 Change-Id: I5491e43bd068917524e3773431523b86522b1de2 Reviewed-on: https://chromium-review.googlesource.com/c/1407779 Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org> Commit-Queue: Parastoo Geranmayeh <parastoog@google.com> Cr-Commit-Position: refs/heads/master@{#624779} [modify] https://crrev.com/b70dc4c12e5befdbe56883cb58ca5c6151fd6171/components/autofill/core/browser/autofill_data_model.cc [modify] https://crrev.com/b70dc4c12e5befdbe56883cb58ca5c6151fd6171/components/autofill/core/browser/autofill_data_model.h [modify] https://crrev.com/b70dc4c12e5befdbe56883cb58ca5c6151fd6171/components/autofill/core/browser/autofill_profile.cc
Comment 1 by parastoog@chromium.org
, Today (15 hours ago)