Skip to content

Fix backup creation crashing on missing session data#177

Open
duncanplatt wants to merge 1 commit intophotodiode:masterfrom
duncanplatt:fix/backup-null-session-data
Open

Fix backup creation crashing on missing session data#177
duncanplatt wants to merge 1 commit intophotodiode:masterfrom
duncanplatt:fix/backup-null-session-data

Conversation

@duncanplatt
Copy link
Copy Markdown
Contributor

Summary

  • backup.create() crashes when a window has no groups stored in session data, or when a group has no stored rect value — both result in a TypeError on a null/undefined reference
  • This broke both manual "Save As" and automatic backups, likely since Firefox 148 changed session storage behavior around January 2026
  • Skip windows with missing group data instead of crashing
  • Fall back to default rect {x:0, y:0, w:0.5, h:0.5} (same default used in view.js) when a group has no stored position

Test plan

  • Open options page and click "Save As" — should prompt a file save
  • Verify the saved JSON contains correct group/tab data
  • Trigger an automatic backup (set interval, wait, check dropdown)
  • Restore a backup and verify groups/tabs are recreated

backup.create() crashes when a window has no groups in session storage
or a group has no stored rect, both of which can occur after Firefox 148
changed session data behavior (Bug 2002643). This broke both manual
"Save As" and automatic backups since ~January 2026.

- Add null check for groups from getWindowValue, skip windows with no
  group data instead of crashing on groups.sort()
- Add fallback rect {x:0, y:0, w:0.5, h:0.5} when getGroupValue
  returns undefined, matching the default used in view.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant