New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 736006 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Jul 6
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

[Sync] USS should preserve unknown fields in EntitySpecifics

Project Member Reported by pav...@chromium.org, Jun 22 2017

Issue description

Directory datatypes support preserving unknown fields from future versions of code. This is done in WriteNode::SetEntitySpecifics. USS should do the same.
 

Comment 1 by mastiz@chromium.org, Dec 18 2017

Cc: mastiz@chromium.org

Comment 2 by s...@chromium.org, Dec 18 2017

Cc: s...@chromium.org
I didn't realize we hadn't done this yet. I thought we were putting them in the entity metadata, but looking through the code, I don't see anywhere that does it.

Comment 3 by zea@chromium.org, Dec 18 2017

Labels: -Pri-3 M-65 Pri-1
This seems like a pretty important thing to get in. Without this, we can break forwards compatibility with future versions that introduce new fields (although granted it's rare to have a field that needs to be preserved in the face of a local update)

Bumping priority. 

Comment 4 by mastiz@chromium.org, Dec 18 2017

Owner: mastiz@chromium.org
Status: Assigned (was: Available)
Some more details or pointers about the requirements would be appreciated :-)

If they don't exist already, I would start with introducing browser tests that capture the desired external behavior.

Based on the unit tests that I can see, e.g.  BaseNodeSetSpecificsPreservesUnknownFields, introduced with  crbug.com/83982  long time ago, I see no specific scenario described.

A scenario I can guess is:
1. A bookmark exists sync-ed across two distinct versions of Chrome, one having support for new proto fields.
2. A local modification is done in the old client, say, change the name.
3. The new client would want the field unmodified.

It however seems a stretch that propagating an unknown field is a universal solution (e.g. if the new field is "last accessed time"), but I guess it's the best we can do, and consistent with pre-USS clients.

Comment 5 by zea@chromium.org, Dec 18 2017

Yeah, that's exactly right. In theory any new field like that won't be critical (since new entities created by old clients will definitely not have it filled), but it would still be good to preserve if we can.

Comment 6 by mastiz@chromium.org, Dec 20 2017

Labels: -Pri-1 Pri-2
Readjusting priority after realizing this is not what I thought it was, and the example above might be totally off.

Unknown proto fields in the actual datatype specifics (e.g. PrinterSpecifics) are responsibility of the bridge implementation and the model itself, hence we'd need to file individual bugs if this regressed in the process of migrating them to USS, because the APIs (including ModelTypeStore) actually support this well. pavely@: please help asses the situation.

For example, taking a look at PrintersSyncBridge, it seems like  PrinterToSpecifics() needs to be fixed to begin with.

On the other hand, what this bug's description suggests, based on the reference to WriteNode::SetEntitySpecifics, is specifically the unknown proto fields for the message EntitySpecifics. This seems less important (and unrelated to the scenario described earlier), and probably involves extending syncer::EntityData to keep unknown field values around.

Comment 7 by mastiz@chromium.org, Dec 20 2017

As per my comment above, and regarding the specific datatypes, it'd be nice that we would add test coverage for unknown proto field handling to all USS datatypes, via a common test suite: crbug.com/796534

Comment 8 by treib@chromium.org, Apr 30 2018

Triage ping: Any updates on this? Seems like we'd really want to have this before launching any major data type (like BOOKMARKS) with USS.

Comment 9 by treib@chromium.org, Jun 7 2018

Triage ping again: Is this still relevant?
Labels: sync-fixit-2018q3
I have mixed feelings about this bug, but marking it as candidate for our upcoming fixit.
Status: Started (was: Assigned)
Status: WontFix (was: Started)
I took another look at decided in doesn't make much sense. Rationale:
1. Unknown fields directly within EntitySpecifics (being a oneof, effectively) almost certainly means an unknown datatype, hence there's no point is bothering.

2. Unknown fields in nested messages (e.g. BookmarkSpecifics) are hard to implement. It is a much more likely scenario, but is anyway not supported by legacy clients either (directory), which I verified by locally modifying test BaseNodeSetSpecificsPreservesUnknownFields.

Sign in to add a comment