Skip to content

feat(backend): add events rules/indexes and messages timestamp overrides - #63

Merged
aryavenkatesan merged 2 commits into
mainfrom
backend/events-rules-and-indexes
Jul 26, 2026
Merged

feat(backend): add events rules/indexes and messages timestamp overrides#63
aryavenkatesan merged 2 commits into
mainfrom
backend/events-rules-and-indexes

Conversation

@aryavenkatesan

Copy link
Copy Markdown
Collaborator

Backend counterpart to the calendar (#42) and chat search (#43) features, which merged without it.

Why this is needed

firestore.rules ends with a catch-all match /{document=**} { allow read, write: if false; }. With no /events rule, every calendar read is denied#42 is non-functional without this. Likewise the calendar's date + startTime query and chat search's collection-group query on messages.timestamp have no matching index to run against.

Changes

  • events rule — signed-in read; create/update/delete stay false (writes are server-side only, matching the pattern used by neighboring collections).
  • events index on (date ASC, startTime ASC) — the calendar's ordered date query.
  • messages.timestamp fieldOverrides incl. COLLECTION_GROUP / DESCENDING — required by chat search's collection-group query.
  • referrals index on (isDeleted ASC, dateSubmitted DESC).
  • web/.gitignore — ignore the Vite cache dir, which was showing up as untracked.

Notes

These rules are already deployed to Firebase; this PR brings the repo in line with the deployed state rather than introducing a new change to production.

No conflict with #61 — that PR edits the helper/users/patients regions of firestore.rules; this adds an events block those hunks don't touch.

🤖 Generated with Claude Code

aryavenkatesan and others added 2 commits July 26, 2026 17:09
Backend counterpart to the calendar (#42) and chat search (#43) features,
which merged without it. Without these, the catch-all deny at the end of
firestore.rules blocks every /events read, and the calendar's
date+startTime query has no composite index to run against.

- events: signed-in read, writes stay server-side only
- events index on (date ASC, startTime ASC) for the calendar query
- messages.timestamp fieldOverrides incl. COLLECTION_GROUP DESCENDING,
  required by chat search's collection-group query
- referrals index on (isDeleted ASC, dateSubmitted DESC)

These rules are already deployed to Firebase; this commit brings the
repo in line with the deployed state.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@aryavenkatesan
aryavenkatesan merged commit c6ffa8e into main Jul 26, 2026
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