Storage workflow
Work through these steps in order. Each one builds on the last, so resist skipping ahead even if a step feels familiar.
- Choose a bucket visibility model before uploading anything.
- Create upload and read policies for the intended user role.
- Use stable paths that include an ownership boundary where appropriate.
- Store the object path in the database, not a temporary upload response alone.
- Test access after refresh and from a second user account.
Realtime workflow
Subscribe to the exact table and event set the screen needs. Confirm the table is enabled for realtime, the filter uses the correct column and the authenticated session is present before opening the subscription.
- Keep subscription cleanup tied to the component lifecycle.
- Avoid subscribing to an entire large table when a filtered stream is enough.
- Handle reconnects and show the last known state honestly.
- Do not use realtime to compensate for missing initial data loading.
Storage handover checklist
The list below breaks this down into the parts that matter most. Read through each one and note anything that applies to your own setup.
- Bucket visibility (public, signed URL or authenticated only) is documented and matches the policies.
- File size and type limits are enforced before upload, not only assumed.
- Orphaned files are handled: deleting a database row also removes or schedules removal of the associated object.
- Uploaded paths cannot be guessed to access another user's file.
- Thumbnails or derived files are regenerated correctly after the source file changes.
Realtime diagnostic sequence
Work through these steps in order. Each one builds on the last, so resist skipping ahead even if a step feels familiar.
- Confirm a plain select query returns the expected rows for the user.
- Confirm the table has realtime enabled at the database level.
- Check the subscription filter matches the column and value used in the actual data.
- Watch the browser console for subscription connect, disconnect and error events.
- Confirm the component unsubscribes on unmount to avoid duplicate or stale event handlers.