Closed Bug 1888023 Opened 2 years ago Closed 2 years ago

Rearrange data in sync records

Categories

(Thunderbird :: General, task)

task

Tracking

(Not tracked)

RESOLVED FIXED
128 Branch

People

(Reporter: darktrojan, Assigned: darktrojan)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

When I first created the sync engines, I had them create records that stored almost all data under a prefs key. Thinking about it some more, and with different clients in mind, some data is essential for recreating the synced account/book/calendar/identity and should be in the top level of the record object. Optional things can remain in the prefs key and each client can decide what to do with it.

For example an account:

{
  "id": "2c4ed593-414b-40de-ab77-5e81732ecdd9",
  "username": "username",
  "hostname": "new.hostname",
  "type": "imap",
  "prefs": {
    "authMethod": 3,
    "biffMinutes": 10,
    "doBiff": true,
    "downloadOnBiff": false,
    "emptyTrashOnExit": false,
    "incomingDuplicateAction": 0,
    "limitOfflineMessageSize": false,
    "loginAtStartUp": false,
    "maxMessageSize": 50,
    "port": 143,
    "prettyName": "New IMAP Server",
    "socketType": 0
  }
}

would instead be:

{
  "id": "2c4ed593-414b-40de-ab77-5e81732ecdd9",
  "prettyName": "New IMAP Server",
  // essential things
  "type": "imap",
  "hostname": "new.hostname",
  "port": 143,
  "socketType": 0,
  "authMethod": 3,
  "username": "username",
  // optional things
  "prefs": {
    "biffMinutes": 10,
    "doBiff": true,
    "downloadOnBiff": false,
    "emptyTrashOnExit": false,
    "incomingDuplicateAction": 0,
    "limitOfflineMessageSize": false,
    "loginAtStartUp": false,
    "maxMessageSize": 50
  }
}

I also intend to rename some of the fields, e.g. use name consistently across all record types, and use strings instead of numeric constants for some fields, e.g. "alwaysSTARTTLS" instead of 2 (which is Ci.nsMsgSocketType.alwaysSTARTTLS on desktop but meaningless elsewhere).

Attachment #9393409 - Attachment description: WIP: Bug 1888023 - Rearrange data in sync records → Bug 1888023 - Rebuild sync engines and tests. r=#thunderbird-reviewers
Target Milestone: --- → 128 Branch

Pushed by benc@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/b738286f6283
Rebuild sync engines and tests. r=mkmelin

Pushed by benc@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/4f734187ad1e
Document the sync record types and process for extending them. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Regressions: 1909393
Regressions: 1909424
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: