Fix for missing rules in backups - #2860
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughBackup archives now preserve authorized redirect origins and additional metadata. Restore initialization recreates those origins. The restore form inspects selected ZIP files and warns when the backup lacks an app ID. ChangesBackup and restore flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Backup as Backup generation
participant OriginModel as Authorized redirect-origin model
participant Archive as Backup archive
participant Restore as Restore initialization
participant RestoreForm as Restore form
Backup->>OriginModel: Retrieve app redirect origins
OriginModel-->>Backup: Return authorized origins
Backup->>Archive: Write origins and metadata to config.json
Restore->>Archive: Read backup configuration
Restore->>OriginModel: Create authorized redirect origins
OriginModel-->>Restore: Confirm restored origins
RestoreForm->>Archive: Read config.json from selected ZIP
Archive-->>RestoreForm: Return parsed configuration
RestoreForm-->>RestoreForm: Warn when appId is missing
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View Vercel preview at instant-www-js-backups-fixes-jsv.vercel.app. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@client/www/app/intern/restore/content.tsx`:
- Around line 104-110: Update onFileChange so each file selection, including
clearing the selection, invalidates earlier readBackupConfig results before they
can update rulesWarning. Track a per-selection token or cancel the prior
inspection, and only apply missingRulesWarning(config) when the result belongs
to the current selection.
- Around line 198-200: Update the file input’s styling in the restore upload
control so it remains visually hidden but focusable and keyboard-operable
instead of using className="hidden". Preserve the existing onChange handler and
label-based file selection behavior, ensuring keyboard users can activate the
picker through the associated control.
- Around line 64-65: Update missingRulesWarning to validate that config is a
non-array object containing the required schema key before checking
config.appId. Only return the warning for this valid backup-config shape when
appId is absent; leave other values, including empty objects, arrays, and
strings, without a warning.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5b0d02ec-2445-4d4b-a01f-3774f5e7cc55
📒 Files selected for processing (3)
client/www/app/intern/restore/content.tsxserver/src/instant/backup.cljserver/src/instant/restore.clj
Fixes missing rules in the backup (I was passing
app-idinstead of{:app-id app-id}).It also includes the authorized redirect URIs (those are stored in our db instead of the triples table) and more metadata about the backup.
Retore will now restore the redirect URIs and it will show a warning if you're importing a backup that might be missing the rules.