Skip to content

Week : 9 resolves duplicate surveys issue and secures data.

Choose a tag to compare

@danythost danythost released this 26 Jun 23:22

Overview
This release focuses on solidifying the Admin Survey Management functionality, enforcing data security through Firestore rules, and optimizing application performance. It successfully resolves previous issues with duplicate survey listings and improves the administrative dashboard's user experience.

Firestore Security Rules:
Deployed strict role-based access control (RBAC). Only authorized administrators can create, modify, or delete surveys and read all answers. Regular users are securely restricted to reading surveys and submitting their own answers.

Admin Dashboard Upgrades:
Implemented a confirmation step (Confirm/Cancel UI) for survey deletion to prevent accidental data loss.
Added loading indicators and disabled states to the "Publish to Network" button for better feedback during submission.
Improved error handling and surfacing for failed admin operations

Resilient Authentication:
Added a fallback mechanism to signInWithRedirect in AuthContext to handle scenarios where signInWithPopup is blocked (improves mobile and production login reliability).

Bug Fixes
Survey Deduplication (Idempotency):
Refactored seedSurveys.ts to use deterministic, slug-based IDs, ensuring re-runs do not create duplicate survey entries.
Added a one-time cleanup script (cleanupDuplicateSurveys.ts) to purge any existing duplicate surveys from the database.
Implemented client-side deduplication as a fail-safe when fetching surveys.