Home | History | Annotate | Download | only in protocol
      1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 //
      5 // Sync protocol for communication between sync client and server.
      6 
      7 // Update proto_value_conversions{.h,.cc,_unittest.cc} if you change
      8 // any fields in this file.
      9 
     10 syntax = "proto2";
     11 
     12 option optimize_for = LITE_RUNTIME;
     13 option retain_unknown_fields = true;
     14 
     15 package sync_pb;
     16 
     17 import "encryption.proto";
     18 
     19 // Used for inspecting how long we spent performing operations in different
     20 // backends. All times must be in millis.
     21 message ProfilingData {
     22   optional int64 meta_data_write_time = 1;
     23   optional int64 file_data_write_time = 2;
     24   optional int64 user_lookup_time = 3;
     25   optional int64 meta_data_read_time = 4;
     26   optional int64 file_data_read_time = 5;
     27   optional int64 total_request_time = 6;
     28 }
     29 
     30 message EntitySpecifics {
     31   // If a datatype is encrypted, this field will contain the encrypted
     32   // original EntitySpecifics. The extension for the datatype will continue
     33   // to exist, but contain only the default values.
     34   // Note that currently passwords employ their own legacy encryption scheme and
     35   // do not use this field.
     36   optional EncryptedData encrypted = 1;
     37 
     38   // To add new datatype-specific fields to the protocol, extend
     39   // EntitySpecifics.  First, pick a non-colliding tag number by
     40   // picking a revision number of one of your past commits
     41   // to src.chromium.org.  Then, in a different protocol buffer
     42   // definition that includes this, do the following:
     43   //
     44   //   extend EntitySpecifics {
     45   //     MyDatatypeSpecifics my_datatype = 32222;
     46   //   }
     47   //
     48   // where:
     49   //   - 32222 is the non-colliding tag number you picked earlier.
     50   //   - MyDatatypeSpecifics is the type (probably a message type defined
     51   //     in your new .proto file) that you want to associate with each
     52   //     object of the new datatype.
     53   //   - my_datatype is the field identifier you'll use to access the
     54   //     datatype specifics from the code.
     55   //
     56   // Server implementations are obligated to preserve the contents of
     57   // EntitySpecifics when it contains unrecognized extensions.  In this
     58   // way, it is possible to add new datatype fields without having
     59   // to update the server.
     60   extensions 30000 to max;
     61 }
     62 
     63 message SyncEntity {
     64   // This item's identifier.  In a commit of a new item, this will be a
     65   // client-generated ID.  If the commit succeeds, the server will generate
     66   // a globally unique ID and return it to the committing client in the
     67   // CommitResponse.EntryResponse.  In the context of a GetUpdatesResponse,
     68   // |id_string| is always the server generated ID.  The original
     69   // client-generated ID is preserved in the |originator_client_id| field.
     70   // Present in both GetUpdatesResponse and CommitMessage.
     71   optional string id_string = 1;
     72 
     73   // An id referencing this item's parent in the hierarchy.  In a
     74   // CommitMessage, it is accepted for this to be a client-generated temporary
     75   // ID if there was a new created item with that ID appearing earlier
     76   // in the message.  In all other situations, it is a server ID.
     77   // Present in both GetUpdatesResponse and CommitMessage.
     78   optional string parent_id_string = 2;
     79 
     80   // old_parent_id is only set in commits and indicates the old server
     81   // parent(s) to remove. When omitted, the old parent is the same as
     82   // the new.
     83   // Present only in CommitMessage.
     84   optional string old_parent_id = 3;
     85 
     86   // The version of this item -- a monotonically increasing value that is
     87   // maintained by for each item.  If zero in a CommitMessage, the server
     88   // will interpret this entity as a newly-created item and generate a
     89   // new server ID and an initial version number.  If nonzero in a
     90   // CommitMessage, this item is treated as an update to an existing item, and
     91   // the server will use |id_string| to locate the item.  Then, if the item's
     92   // current version on the server does not match |version|, the commit will
     93   // fail for that item.  The server will not update it, and will return
     94   // a result code of CONFLICT.  In a GetUpdatesResponse, |version| is
     95   // always positive and indentifies the revision of the item data being sent
     96   // to the client.
     97   // Present in both GetUpdatesResponse and CommitMessage.
     98   required int64 version = 4;
     99 
    100   // Last modification time (in java time milliseconds)
    101   // Present in both GetUpdatesResponse and CommitMessage.
    102   optional int64 mtime = 5;
    103 
    104   // Creation time.
    105   // Present in both GetUpdatesResponse and CommitMessage.
    106   optional int64 ctime = 6;
    107 
    108   // The name of this item.
    109   // Historical note:
    110   //   Since November 2010, this value is no different from non_unique_name.
    111   //   Before then, server implementations would maintain a unique-within-parent
    112   //   value separate from its base, "non-unique" value.  Clients had not
    113   //   depended on the uniqueness of the property since November 2009; it was
    114   //   removed from Chromium by http://codereview.chromium.org/371029 .
    115   // Present in both GetUpdatesResponse and CommitMessage.
    116   required string name = 7;
    117 
    118   // The name of this item.  Same as |name|.
    119   // |non_unique_name| should take precedence over the |name| value if both
    120   // are supplied.  For efficiency, clients and servers should avoid setting
    121   // this redundant value.
    122   // Present in both GetUpdatesResponse and CommitMessage.
    123   optional string non_unique_name = 8;
    124 
    125   // A value from a monotonically increasing sequence that indicates when
    126   // this item was last updated on the server. This is now equivalent
    127   // to version. This is now deprecated in favor of version.
    128   // Present only in GetUpdatesResponse.
    129   optional int64 sync_timestamp = 9;
    130 
    131   // If present, this tag identifies this item as being a uniquely
    132   // instanced item.  The server ensures that there is never more
    133   // than one entity in a user's store with the same tag value.
    134   // This value is used to identify and find e.g. the "Google Chrome" settings
    135   // folder without relying on it existing at a particular path, or having
    136   // a particular name, in the data store.
    137   //
    138   // This variant of the tag is created by the server, so clients can't create
    139   // an item with a tag using this field.
    140   //
    141   // Use client_defined_unique_tag if you want to create one from the client.
    142   //
    143   // An item can't have both a client_defined_unique_tag and
    144   // a server_defined_unique_tag.
    145   //
    146   // Present only in GetUpdatesResponse.
    147   optional string server_defined_unique_tag = 10;
    148 
    149   // If this group is present, it implies that this SyncEntity corresponds to
    150   // a bookmark or a bookmark folder.
    151   //
    152   // This group is deprecated; clients should use the bookmark EntitySpecifics
    153   // protocol buffer extension instead.
    154   optional group BookmarkData = 11 {
    155     // We use a required field to differentiate between a bookmark and a
    156     // bookmark folder.
    157     // Present in both GetUpdatesMessage and CommitMessage.
    158     required bool bookmark_folder = 12;
    159 
    160     // For bookmark objects, contains the bookmark's URL.
    161     // Present in both GetUpdatesResponse and CommitMessage.
    162     optional string bookmark_url = 13;
    163 
    164     // For bookmark objects, contains the bookmark's favicon. The favicon is
    165     // represented as a 16X16 PNG image.
    166     // Present in both GetUpdatesResponse and CommitMessage.
    167     optional bytes bookmark_favicon = 14;
    168   }
    169 
    170   // Supplies a numeric position for this item, relative to other items with
    171   // the same parent.  This value is only meaningful in server-to-client
    172   // contexts; to specify a position in a client-to-server commit context,
    173   // use |insert_after_item_id|.
    174   // Present only in GetUpdatesResponse.
    175   optional int64 position_in_parent = 15;
    176 
    177   // Contains the ID of the element (under the same parent) after which this
    178   // element resides. An empty string indicates that the element is the first
    179   // element in the parent.  This value is used during commits to specify
    180   // a relative position for a position change.  In the context of
    181   // a GetUpdatesMessage, |position_in_parent| is used instead to
    182   // communicate position.
    183   // Present only in CommitMessage.
    184   optional string insert_after_item_id = 16;
    185 
    186   // Arbitrary key/value pairs associated with this item.
    187   // Present in both GetUpdatesResponse and CommitMessage.
    188   // Deprecated.
    189   // optional ExtendedAttributes extended_attributes = 17;
    190 
    191   // If true, indicates that this item has been (or should be) deleted.
    192   // Present in both GetUpdatesResponse and CommitMessage.
    193   optional bool deleted = 18 [default = false];
    194 
    195   // A GUID that identifies the the sync client who initially committed
    196   // this entity.  This value corresponds to |cache_guid| in CommitMessage.
    197   // This field, along with |originator_client_item_id|, can be used to
    198   // reunite the original with its official committed version in the case
    199   // where a client does not receive or process the commit response for
    200   // some reason.
    201   // Present only in GetUpdatesResponse.
    202   optional string originator_cache_guid = 19;
    203 
    204   // The local item id of this entry from the client that initially
    205   // committed this entity. Typically a negative integer.
    206   // Present only in GetUpdatesResponse.
    207   optional string originator_client_item_id = 20;
    208 
    209   // Extensible container for datatype-specific data.
    210   // This became available in version 23 of the protocol.
    211   optional EntitySpecifics specifics = 21;
    212 
    213   // Indicate whether this is a folder or not. Available in version 23+.
    214   optional bool folder = 22 [default = false];
    215 
    216   // A client defined unique hash for this entity.
    217   // Similar to server_defined_unique_tag.
    218   //
    219   // When initially committing an entity, a client can request that the entity
    220   // is unique per that account. To do so, the client should specify a
    221   // client_defined_unique_tag. At most one entity per tag value may exist.
    222   // per account. The server will enforce uniqueness on this tag
    223   // and fail attempts to create duplicates of this tag.
    224   // Will be returned in any updates for this entity.
    225   //
    226   // The difference between server_defined_unique_tag and
    227   // client_defined_unique_tag is the creator of the entity. Server defined
    228   // tags are entities created by the server at account creation,
    229   // while client defined tags are entities created by the client at any time.
    230   //
    231   // During GetUpdates, a sync entity update will come back with ONE of:
    232   // a) Originator and cache id - If client committed the item as non "unique"
    233   // b) Server tag - If server committed the item as unique
    234   // c) Client tag - If client committed the item as unique
    235   //
    236   // May be present in CommitMessages for the initial creation of an entity.
    237   // If present in Commit updates for the entity, it will be ignored.
    238   //
    239   // Available in version 24+.
    240   //
    241   // May be returned in GetUpdatesMessage and sent up in CommitMessage.
    242   //
    243   optional string client_defined_unique_tag = 23;
    244 };
    245 
    246 // This message contains diagnostic information used to correlate
    247 // commit-related traffic with extensions-related mutations to the
    248 // data models in chromium.  It plays no functional role in
    249 // processing this CommitMessage.
    250 message ChromiumExtensionsActivity {
    251   // The human-readable ID identifying the extension responsible
    252   // for the traffic reported in this ChromiumExtensionsActivity.
    253   optional string extension_id = 1;
    254 
    255   // How many times the extension successfully invoked a write
    256   // operation through the bookmarks API since the last CommitMessage.
    257   optional uint32 bookmark_writes_since_last_commit = 2;
    258 };
    259 
    260 message CommitMessage {
    261   repeated SyncEntity entries = 1;
    262 
    263   // A GUID that identifies the committing sync client.  This value will be
    264   // returned as originator_cache_guid for any new items.
    265   optional string cache_guid = 2;
    266 
    267   repeated ChromiumExtensionsActivity extensions_activity = 3;
    268 };
    269 
    270 message GetUpdatesCallerInfo {
    271   enum GetUpdatesSource {
    272     UNKNOWN = 0;  // The source was not set by the caller.
    273     FIRST_UPDATE = 1;  // First update from an instance of Chrome.
    274     LOCAL = 2;  // The source of the update was a local change.
    275     NOTIFICATION = 3;  // The source of the update was a p2p notification.
    276     PERIODIC = 4;  // The source of the update was periodic polling.
    277     SYNC_CYCLE_CONTINUATION = 5;  // The source of the update was a
    278                                   // continuation of a previous update.
    279     CLEAR_PRIVATE_DATA = 6;       // Source is a call to remove all private data
    280   }
    281 
    282   required GetUpdatesSource source = 1;
    283 
    284   // True only if notifications were enabled for this GetUpdateMessage.
    285   optional bool notifications_enabled = 2;
    286 };
    287 
    288 message DataTypeProgressMarker {
    289   // An integer identifying the data type whose progress is tracked by this
    290   // marker.  The legitimate values of this field correspond to the protobuf
    291   // field numbers of all EntitySpecifics extensions supported by the server.
    292   // These values are externally declared in per-datatype .proto files.
    293   optional int32 data_type_id = 1;
    294 
    295   // An opaque-to-the-client sequence of bytes that the server may interpret
    296   // as an indicator of the client's knowledge state.  If this is empty or
    297   // omitted by the client, it indicates that the client is initiating a
    298   // a first-time sync of this datatype.  Otherwise, clients must supply a
    299   // value previously returned by the server in an earlier GetUpdatesResponse.
    300   // These values are not comparable or generable on the client.
    301   //
    302   // The opaque semantics of this field are to afford server implementations
    303   // some flexibility in implementing progress tracking.  For instance,
    304   // a server implementation built on top of a distributed storage service --
    305   // or multiple heterogenous such services -- might need to supply a vector
    306   // of totally ordered monotonic update timestamps, rather than a single
    307   // monotonically increasing value.  Other optimizations may also be
    308   // possible if the server is allowed to embed arbitrary information in
    309   // the progress token.
    310   //
    311   // Server implementations should keep the size of these tokens relatively
    312   // small, on the order of tens of bytes, and they should remain small
    313   // regardless of the number of items synchronized.  (A possible bad server
    314   // implementation would be for progress_token to contain a list of all the
    315   // items ever sent to the client.  Servers shouldn't do this.)
    316   optional bytes token = 2;
    317 
    318   // Clients that previously downloaded updates synced using the timestamp based
    319   // progress tracking mechanism, but which wish to switch over to the opaque
    320   // token mechanism can set this field in a GetUpdatesMessage.  The server
    321   // will perform a get updates operation as normal from the indicated
    322   // timestamp, and return only an opaque progress token.
    323   optional int64 timestamp_token_for_migration = 3;
    324 
    325   // An opaque-to-the-client string of bytes, received through a notification,
    326   // that the server may interpret as a hint about the location of the latest
    327   // version of the data for this type.
    328   optional string notification_hint = 4;
    329 }
    330 
    331 message GetUpdatesMessage {
    332   // Indicates the client's current progress in downloading updates.  A
    333   // from_timestamp value of zero means that the client is requesting a first-
    334   // time sync.  After that point, clients should fill in this value with the
    335   // value returned in the last-seen GetUpdatesResponse.new_timestamp.
    336   //
    337   // from_timestamp has been deprecated; clients should use
    338   // |from_progress_marker| instead, which allows more flexibility.
    339   optional int64 from_timestamp = 1;
    340 
    341   // Indicates the reason for the GetUpdatesMessage.
    342   optional GetUpdatesCallerInfo caller_info = 2;
    343 
    344   // Indicates whether related folders should be fetched.
    345   optional bool fetch_folders = 3 [default = true];
    346 
    347   // The presence of an individual EntitySpecifics extension indicates that the
    348   // client requests sync object types associated with that extension.  This
    349   // determination depends only on the presence of the extension field, not its
    350   // contents -- thus clients should send empty extension messages.  For
    351   // backwards compatibility only bookmark objects will be sent to the client
    352   // should requested_types not be present.
    353   //
    354   // requested_types may contain multiple EntitySpecifics extensions -- in this
    355   // event, the server will return items of all the indicated types.
    356   //
    357   // requested_types has been deprecated; clients should use
    358   // |from_progress_marker| instead, which allows more flexibility.
    359   optional EntitySpecifics requested_types = 4;
    360 
    361   // Client-requested limit on the maximum number of updates to return at once.
    362   // The server may opt to return fewer updates than this amount, but it should
    363   // not return more.
    364   optional int32 batch_size = 5;
    365 
    366   // Per-datatype progress marker.  If present, the server will ignore
    367   // the values of requested_types and from_timestamp, using this instead.
    368   repeated DataTypeProgressMarker from_progress_marker = 6;
    369 
    370   // Indicates whether the response should be sent in chunks.  This may be
    371   // needed for devices with limited memory resources.  If true, the response
    372   // will include one or more ClientToServerResponses, with the frist one
    373   // containing GetUpdatesMetadataResponse, and the remaining ones, if any,
    374   // containing GetUpdatesStreamingResponse.  These ClientToServerResponses are
    375   // delimited by a length prefix, which is encoded as a varint.
    376   optional bool streaming = 7 [default = false];
    377 };
    378 
    379 message AuthenticateMessage {
    380   required string auth_token = 1;
    381 };
    382 
    383 // This message is sent to the server to clear data.  An asynchronous
    384 // response is returned to the client indicating that the server has received
    385 // the request and has begun to clear data.
    386 message ClearUserDataMessage {
    387 }
    388 
    389 message ClearUserDataResponse {
    390 }
    391 
    392 message ClientToServerMessage {
    393   required string share = 1;
    394   optional int32 protocol_version = 2 [default = 26];
    395   enum Contents {
    396     COMMIT = 1;
    397     GET_UPDATES = 2;
    398     AUTHENTICATE = 3;
    399     CLEAR_DATA = 4;
    400   }
    401 
    402   required Contents message_contents = 3;
    403   optional CommitMessage commit = 4;
    404   optional GetUpdatesMessage get_updates = 5;
    405   optional AuthenticateMessage authenticate = 6;
    406   // Request to clear all Chromium data from the server
    407   optional ClearUserDataMessage clear_user_data = 9;
    408 
    409   optional string store_birthday = 7; // Opaque store ID; if it changes, duck!
    410   // The client sets this if it detects a sync issue. The server will tell it
    411   // if it should perform a refresh.
    412   optional bool sync_problem_detected = 8 [default = false];
    413 };
    414 
    415 message CommitResponse {
    416   enum ResponseType {
    417     SUCCESS = 1;
    418     CONFLICT = 2; // You're out of date; update and check your data
    419     // TODO(ncarter): What's the difference between RETRY and TRANSIENT_ERROR?
    420     RETRY = 3; // Someone has a conflicting, non-expired session open
    421     INVALID_MESSAGE = 4; // What the client sent was invalid, and trying again
    422                          // won't help.
    423     OVER_QUOTA = 5; // This operation would put you, or you are, over quota
    424     TRANSIENT_ERROR = 6; // Something went wrong; try again in a bit
    425   }
    426   repeated group EntryResponse = 1 {
    427     required ResponseType response_type = 2;
    428 
    429     // Sync servers may also return a new ID for an existing item, indicating
    430     // a new entry's been created to hold the data the client's sending up.
    431     optional string id_string = 3;
    432 
    433     // should be filled if our parent was assigned a new ID.
    434     optional string parent_id_string = 4;
    435 
    436     // This value is the same as the position_in_parent value returned within
    437     // the SyncEntity message in GetUpdatesResponse.
    438     optional int64 position_in_parent = 5;
    439 
    440     // The item's current version.
    441     optional int64 version = 6;
    442 
    443     // Allows the server to move-aside an entry as it's being committed.
    444     // This name is the same as the name field returned within the SyncEntity
    445     // message in GetUpdatesResponse.
    446     optional string name = 7;
    447 
    448     // This name is the same as the non_unique_name field returned within the
    449     // SyncEntity message in GetUpdatesResponse.
    450     optional string non_unique_name = 8;
    451 
    452     optional string error_message = 9;
    453 
    454   }
    455 };
    456 
    457 message GetUpdatesResponse {
    458   // New sync entries that the client should apply.
    459   repeated SyncEntity entries = 1;
    460 
    461   // If there are more changes on the server that weren't processed during this
    462   // GetUpdates request, the client should send another GetUpdates request and
    463   // use new_timestamp as the from_timestamp value within GetUpdatesMessage.
    464   //
    465   // This field has been deprecated and will be returned only to clients
    466   // that set the also-deprecated |from_timestamp| field in the update request.
    467   // Clients should use |from_progress_marker| and |new_progress_marker|
    468   // instead.
    469   optional int64 new_timestamp = 2;
    470 
    471   // DEPRECATED FIELD - server does not set this anymore.
    472   optional int64 deprecated_newest_timestamp = 3;
    473 
    474   // Approximate count of changes remaining - use this for UI feedback.
    475   // If present and zero, this estimate is firm: the server has no changes
    476   // after the current batch.
    477   optional int64 changes_remaining = 4;
    478 
    479   // Opaque, per-datatype timestamp-like tokens.  A client should use this
    480   // field in lieu of new_timestamp, which is deprecated in newer versions
    481   // of the protocol.  Clients should retain and persist the values returned
    482   // in this field, and present them back to the server to indicate the
    483   // starting point for future update requests.
    484   //
    485   // This will be sent only if the client provided |from_progress_marker|
    486   // in the update request.
    487   //
    488   // The server may provide a new progress marker even if this is the end of
    489   // the batch, or if there were no new updates on the server; and the client
    490   // must save these.  If the server does not provide a |new_progress_marker|
    491   // value for a particular datatype, when the request provided a
    492   // |from_progress_marker| value for that datatype, the client should
    493   // interpret this to mean "no change from the previous state" and retain its
    494   // previous progress-marker value for that datatype.
    495   //
    496   // Progress markers in the context of a response will never have the
    497   // |timestamp_token_for_migration| field set.
    498   repeated DataTypeProgressMarker new_progress_marker = 5;
    499 };
    500 
    501 // The metadata response for GetUpdatesMessage.  This response is sent when
    502 // streaming is set to true in the request.  It is prefixed with a length
    503 // delimiter, which is encoded in varint.
    504 message GetUpdatesMetadataResponse {
    505   // Approximate count of changes remaining.  Detailed comment is available in
    506   // GetUpdatesResponse.
    507   optional int64 changes_remaining = 1;
    508 
    509   // Opaque, per-datatype timestamp-like tokens.  Detailed comment is available
    510   // in GetUpdatesResponse.
    511   repeated DataTypeProgressMarker new_progress_marker = 2;
    512 };
    513 
    514 // The streaming response message for GetUpdatesMessage.  This message is sent
    515 // when streaming is set to true in the request.  There may be multiple
    516 // GetUpdatesStreamingResponse messages in a response.  This type of messages
    517 // is preceded by GetUpdatesMetadataResponse.  It is prefixed with a length
    518 // delimiter, which is encoded in varint.
    519 message GetUpdatesStreamingResponse {
    520   // New sync entries that the client should apply.
    521   repeated SyncEntity entries = 1;
    522 };
    523 
    524 // A user-identifying struct.  For a given Google account the email and display
    525 // name can change, but obfuscated_id should be constant.
    526 // The obfuscated id is optional because at least one planned use of the proto
    527 // (sharing) does not require it.
    528 message UserIdentification {
    529   required string email = 1;  // the user's full primary email address.
    530   optional string display_name = 2;  // the user's display name.
    531   optional string obfuscated_id = 3;  // an obfuscated, opaque user id.
    532 };
    533 
    534 message AuthenticateResponse {
    535   // Optional only for backward compatibility.
    536   optional UserIdentification user = 1;
    537 };
    538 
    539 message ThrottleParameters {
    540   // Deprecated. Remove this from the server side.
    541   required int32 min_measure_payload_size = 1;
    542   required double target_utilization = 2;
    543   required double measure_interval_max = 3;
    544   required double measure_interval_min = 4;
    545   required double observation_window = 5;
    546 };
    547 
    548 // A command from the server instructing the client to update settings or
    549 // perform some operation.
    550 message ClientCommand {
    551   // Time to wait before sending any requests to the server.
    552   optional int32 set_sync_poll_interval = 1;  // in seconds
    553   optional int32 set_sync_long_poll_interval = 2;  // in seconds
    554 
    555   optional int32 max_commit_batch_size = 3;
    556 };
    557 
    558 message ClientToServerResponse {
    559   optional CommitResponse commit = 1;
    560   optional GetUpdatesResponse get_updates = 2;
    561   optional AuthenticateResponse authenticate = 3;
    562   optional ClearUserDataResponse clear_user_data = 9;
    563   optional GetUpdatesMetadataResponse stream_metadata = 10;
    564   // If GetUpdatesStreamingResponse is contained in the ClientToServerResponse,
    565   // none of the other fields (error_code and etc) will be set.
    566   optional GetUpdatesStreamingResponse stream_data = 11;
    567 
    568   enum ErrorType {
    569     SUCCESS            = 0;
    570     ACCESS_DENIED      = 1;   // Returned when the user doesn't have access to
    571                               // store (instead of HTTP 401).
    572     NOT_MY_BIRTHDAY    = 2;   // Returned when the server and client disagree on
    573                               // the store birthday.
    574     THROTTLED          = 3;   // Returned when the store has exceeded the
    575                               // allowed bandwidth utilization.
    576     AUTH_EXPIRED       = 4;   // Auth token or cookie has expired.
    577     USER_NOT_ACTIVATED = 5;   // User doesn't have the Chrome bit set on that
    578                               // Google Account.
    579     AUTH_INVALID       = 6;   // Auth token or cookie is otherwise invalid.
    580     CLEAR_PENDING      = 7;   // A clear of the user data is pending (e.g.
    581                               // initiated by privacy request).  Client should
    582                               // come back later.
    583     TRANSIENT_ERROR    = 8;   // A transient error occured (eg. backend
    584                               // timeout). Client should try again later.
    585     MIGRATION_DONE     = 9;   // Migration has finished for one or more data
    586                               // types.  Client should clear the cache for
    587                               // these data types only and then re-sync with
    588                               // a server.
    589     UNKNOWN            = 100; // Unknown value. This should never be explicitly
    590                               // used; it is the default value when an
    591                               // out-of-date client parses a value it doesn't
    592                               // recognize.
    593   }
    594   // Up until protocol_version 24, the default was SUCCESS which made it
    595   // impossible to add new enum values since older clients would parse any
    596   // out-of-range value as SUCCESS. Starting with 25, unless explicitly set,
    597   // the error_code will be UNKNOWN so that clients know when they're
    598   // out-of-date. Note also that when using protocol_version < 25,
    599   // TRANSIENT_ERROR is not supported. Instead, the server sends back a HTTP
    600   // 400 error code.
    601   optional ErrorType error_code = 4 [default = UNKNOWN];
    602   optional string error_message = 5;
    603 
    604   // Opaque store ID; if it changes, the contents of the client's cache
    605   // is meaningless to this server.  This happens most typically when
    606   // you switch from one storage backend instance (say, a test instance)
    607   // to another (say, the official instance).
    608   optional string store_birthday = 6;
    609 
    610   optional ClientCommand client_command = 7;
    611   optional ProfilingData profiling_data = 8;
    612 
    613   // The data types whose storage has been migrated.  Present when the value of
    614   // error_code is MIGRATION_DONE.
    615   repeated int32 migrated_data_type_id = 12;
    616 };
    617 
    618