Use 12- or 16-character values in place of a huge encoded appID as the key for prefs

REOPENED
Unassigned

Status

P3
normal
REOPENED
5 years ago
2 years ago

People

(Reporter: rnewman, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa?])

(Reporter)

Description

5 years ago
Essentially every prefs record in Sync is keyed by the same value: 

e2VjODAzMGY3LWMyMGEtNDY0Zi05YjBlLTEzYTNhOWU5NzM4NH0=

which is

const PREFS_GUID = CommonUtils.encodeBase64URL(Services.appinfo.ID);

applied to {ec8030f7-c20a-464f-9b0e-13a3a9e97384}, Firefox's appinfo.ID.

This is dumb. We should use something shorter.
(Reporter)

Updated

5 years ago
Blocks: 959878
(Reporter)

Comment 1

5 years ago
Satchel does this for nsFormHistory entries:

    generateGUID : function() {
        // string like: "{f60d9eac-9421-4abc-8491-8e8322b063d4}"
        let uuid = this.uuidService.generateUUID().toString();
        let raw = ""; // A string with the low bytes set to random values
        let bytes = 0;
        for (let i = 1; bytes < 12 ; i+= 2) {
            // Skip dashes
            if (uuid[i] == "-")
                i++;
            let hexVal = parseInt(uuid[i] + uuid[i + 1], 16);
            raw += String.fromCharCode(hexVal);
            bytes++;
        }
        return btoa(raw);
    },

which is kinda crazy -- it should just use 12-char ones generated in the same manner as for bookmarks -- but it's perfectly applicable to our app IDs.
Summary: Use 12-character values in place of a huge encoded appID as the key for prefs → Use 12- or 16-character values in place of a huge encoded appID as the key for prefs
Whiteboard: [qa?]
Priority: -- → P3
Old Sync 1.1 bug.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
(Reporter)

Comment 3

2 years ago
Still the case for 1.5, fwiw.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
You need to log in before you can comment on or make changes to this bug.