Closed Bug 2088825 Opened 23 days ago Closed 16 days ago

Validate session state against `session.schema.json` on each write when a debug pref is set

Categories

(Firefox :: Session Restore, task)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: dao, Assigned: dao)

References

Details

Attachments

(3 external files)

Only test_session_schema.js checks state against session.schema.json, using a fixed file, so the schema has fallen behind what Firefox writes (bug 1991409, bug 2012815). Add a pref that runs validateState on each write, and turn it on for selected existing browser tests so a change that writes a property the schema doesn't describe fails there. A console warning doesn't fail a browser-chrome test, so a mismatch has to reach the test as a failure.

types/sessionstore.ts should then say why most window and tab state properties are optional, and what a schema mismatch does at runtime.

SessionStore.validateState stops warning about an invalid state: SessionSaver reports it, and test_session_schema.js, its other caller, logs the errors itself.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1292554319f0 https://hg.mozilla.org/integration/autoland/rev/4c3dc0e1acf0 Validate session state against session.schema.json on each write when browser.sessionstore.debug.validate_state is set. r=sfoster,sessionstore-reviewers https://github.com/mozilla-firefox/firefox/commit/c589ddcdc8a2 https://hg.mozilla.org/integration/autoland/rev/957d83d6aef7 Validate written session state in the session store browser tests. r=sfoster,sessionstore-reviewers https://github.com/mozilla-firefox/firefox/commit/7ea1944c5888 https://hg.mozilla.org/integration/autoland/rev/22a673eb6684 Document why most session state properties are optional. r=sfoster,sessionstore-reviewers
Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/66c11309e6d8 https://hg.mozilla.org/integration/autoland/rev/362536f056ea Revert "Bug 2088825 - Document why most session state properties are optional. r=sfoster,sessionstore-reviewers" for causing failures at browser_491577.js.
Blocks: 2091650
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d1cd946b496c https://hg.mozilla.org/integration/autoland/rev/3c890445fdf7 Validate session state against session.schema.json on each write when browser.sessionstore.debug.validate_state is set. r=sfoster,sessionstore-reviewers https://github.com/mozilla-firefox/firefox/commit/ec31fb47e960 https://hg.mozilla.org/integration/autoland/rev/c567029ad9da Validate written session state in the session store browser tests. r=sfoster,sessionstore-reviewers https://github.com/mozilla-firefox/firefox/commit/eb40b47fe7ab https://hg.mozilla.org/integration/autoland/rev/c1ee6479dac7 Document why most session state properties are optional. r=sfoster,sessionstore-reviewers
Flags: needinfo?(dao+bmo)
Status: ASSIGNED → RESOLVED
Closed: 16 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
QA Whiteboard: [qa-triage-done-c163/b162]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: