Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release
[gecko.git] / services / sync / modules / constants.sys.mjs
blob958e3345e60c2395f4c8662766fe7fa11ee859b7
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 // Don't manually modify this line, as it is automatically replaced on merge day
6 // by the gecko_migration.py script.
7 export const WEAVE_VERSION = "1.127.0";
9 // Sync Server API version that the client supports.
10 export const SYNC_API_VERSION = "1.5";
12 // Version of the data format this client supports. The data format describes
13 // how records are packaged; this is separate from the Server API version and
14 // the per-engine cleartext formats.
15 export const STORAGE_VERSION = 5;
16 export const PREFS_BRANCH = "services.sync.";
18 // Put in [] because those aren't allowed in a collection name.
19 export const DEFAULT_KEYBUNDLE_NAME = "[default]";
21 // Key dimensions.
22 export const SYNC_KEY_ENCODED_LENGTH = 26;
23 export const SYNC_KEY_DECODED_LENGTH = 16;
25 export const NO_SYNC_NODE_INTERVAL = 10 * 60 * 1000; // 10 minutes
27 export const MAX_ERROR_COUNT_BEFORE_BACKOFF = 3;
29 // Backoff intervals
30 export const MINIMUM_BACKOFF_INTERVAL = 15 * 60 * 1000; // 15 minutes
31 export const MAXIMUM_BACKOFF_INTERVAL = 8 * 60 * 60 * 1000; // 8 hours
33 // HMAC event handling timeout.
34 // 10 minutes = a compromise between the multi-desktop sync interval
35 // and the mobile sync interval.
36 export const HMAC_EVENT_INTERVAL = 600000;
38 // How long to wait between sync attempts if the Master Password is locked.
39 export const MASTER_PASSWORD_LOCKED_RETRY_INTERVAL = 15 * 60 * 1000; // 15 minutes
41 // 50 is hardcoded here because of URL length restrictions.
42 // (GUIDs can be up to 64 chars long.)
43 // Individual engines can set different values for their limit if their
44 // identifiers are shorter.
45 export const DEFAULT_GUID_FETCH_BATCH_SIZE = 50;
47 // Default batch size for download batching
48 // (how many records are fetched at a time from the server when batching is used).
49 export const DEFAULT_DOWNLOAD_BATCH_SIZE = 1000;
51 // score thresholds for early syncs
52 export const SINGLE_USER_THRESHOLD = 1000;
53 export const MULTI_DEVICE_THRESHOLD = 300;
55 // Other score increment constants
56 export const SCORE_INCREMENT_SMALL = 1;
57 export const SCORE_INCREMENT_MEDIUM = 10;
59 // Instant sync score increment
60 export const SCORE_INCREMENT_XLARGE = 300 + 1; //MULTI_DEVICE_THRESHOLD + 1
62 // Delay before incrementing global score
63 export const SCORE_UPDATE_DELAY = 100;
65 // Delay for the back observer debouncer. This is chosen to be longer than any
66 // observed spurious idle/back events and short enough to pre-empt user activity.
67 export const IDLE_OBSERVER_BACK_DELAY = 100;
69 // Duplicate URI_LENGTH_MAX from Places (from nsNavHistory.h), used to discard
70 // tabs with huge uris during tab sync.
71 export const URI_LENGTH_MAX = 65536;
73 export const MAX_HISTORY_UPLOAD = 5000;
74 export const MAX_HISTORY_DOWNLOAD = 5000;
76 // Top-level statuses
77 export const STATUS_OK = "success.status_ok";
78 export const SYNC_FAILED = "error.sync.failed";
79 export const LOGIN_FAILED = "error.login.failed";
80 export const SYNC_FAILED_PARTIAL = "error.sync.failed_partial";
81 export const CLIENT_NOT_CONFIGURED = "service.client_not_configured";
82 export const STATUS_DISABLED = "service.disabled";
83 export const MASTER_PASSWORD_LOCKED = "service.master_password_locked";
85 // success states
86 export const LOGIN_SUCCEEDED = "success.login";
87 export const SYNC_SUCCEEDED = "success.sync";
88 export const ENGINE_SUCCEEDED = "success.engine";
90 // login failure status codes
91 export const LOGIN_FAILED_NO_USERNAME = "error.login.reason.no_username";
92 export const LOGIN_FAILED_NO_PASSPHRASE = "error.login.reason.no_recoverykey";
93 export const LOGIN_FAILED_NETWORK_ERROR = "error.login.reason.network";
94 export const LOGIN_FAILED_SERVER_ERROR = "error.login.reason.server";
95 export const LOGIN_FAILED_INVALID_PASSPHRASE = "error.login.reason.recoverykey";
96 export const LOGIN_FAILED_LOGIN_REJECTED = "error.login.reason.account";
98 // sync failure status codes
99 export const METARECORD_DOWNLOAD_FAIL =
100   "error.sync.reason.metarecord_download_fail";
101 export const VERSION_OUT_OF_DATE = "error.sync.reason.version_out_of_date";
102 export const CREDENTIALS_CHANGED = "error.sync.reason.credentials_changed";
103 export const ABORT_SYNC_COMMAND = "aborting sync, process commands said so";
104 export const NO_SYNC_NODE_FOUND = "error.sync.reason.no_node_found";
105 export const OVER_QUOTA = "error.sync.reason.over_quota";
106 export const SERVER_MAINTENANCE = "error.sync.reason.serverMaintenance";
108 export const RESPONSE_OVER_QUOTA = "14";
110 // engine failure status codes
111 export const ENGINE_UPLOAD_FAIL = "error.engine.reason.record_upload_fail";
112 export const ENGINE_DOWNLOAD_FAIL = "error.engine.reason.record_download_fail";
113 export const ENGINE_UNKNOWN_FAIL = "error.engine.reason.unknown_fail";
114 export const ENGINE_APPLY_FAIL = "error.engine.reason.apply_fail";
115 // an upload failure where the batch was interrupted with a 412
116 export const ENGINE_BATCH_INTERRUPTED = "error.engine.reason.batch_interrupted";
118 // Ways that a sync can be disabled (messages only to be printed in debug log)
119 export const kSyncMasterPasswordLocked =
120   "User elected to leave Primary Password locked";
121 export const kSyncWeaveDisabled = "Weave is disabled";
122 export const kSyncNetworkOffline = "Network is offline";
123 export const kSyncBackoffNotMet =
124   "Trying to sync before the server said it's okay";
125 export const kFirstSyncChoiceNotMade =
126   "User has not selected an action for first sync";
127 export const kSyncNotConfigured = "Sync is not configured";
128 export const kFirefoxShuttingDown = "Firefox is about to shut down";
130 export const DEVICE_TYPE_DESKTOP = "desktop";
131 export const DEVICE_TYPE_MOBILE = "mobile";
133 export const SQLITE_MAX_VARIABLE_NUMBER = 999;