Skip to content

refactor(telegram): show grants by id and IdP grantor only - #130

Open
BIA3IA wants to merge 2 commits into
mainfrom
refactor/grants-idp-fields
Open

BIA3IA wants to merge 2 commits into
mainfrom
refactor/grants-idp-fields

Conversation

@BIA3IA

@BIA3IA BIA3IA commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to PoliNetworkOrg/backend#93 (RFC v3 Phase 6), which drops the legacy grants table. After that PR every grant is made by an IdP subject, and the backend still returns key, source and grantedBy only as deprecated constants, so that this dashboard keeps working. This PR stops reading them, so the backend can remove them later.

  • Grants page:
    • rows are keyed by grant.id;
    • "Authorized by" shows grantedBySub;
    • the "Source" column is removed;
    • search no longer matches the Telegram grantor.
  • getTelegramGrantsWithGrantors → getTelegramGrants: the batched Telegram lookup of legacy grantors is gone, so the page makes one fewer backend request.
  • User profile: scheduled grants are keyed by id.

Merge order: after PoliNetworkOrg/backend#93 is deployed

Until then production still has legacy grants. Their ids can collide with IdP grant ids (that is what key was for), and they would show no grantor.

Verification

  • pnpm typecheck: OK.
  • pnpm check: 0 errors; the 35 warnings are not in the files I touched.
  • pnpm test: 166 passed, 3 skipped.

Not checked in a browser.

Backend Phase 6 (PoliNetworkOrg/backend#93) drops the legacy grants
table. Every grant now has an IdP grantor, and `key`, `source` and
`grantedBy` are deprecated constants. The grants page and the user
profile now:

- key rows by `id`
- show the grantor's IdP subject only
- drop the Source column and the Telegram grantor lookup
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c5e3c5e6-c53d-4421-b9fc-63b097be89cf
📥 Commits

Reviewing files that changed from the base of the PR and between a838806 and 1adbf85.

📒 Files selected for processing: 4
  • src/features/telegram/grants-page.tsx
  • src/features/telegram/grants.functions.ts
  • src/features/telegram/user-detail/profile.tsx
  • src/routes/dashboard/telegram/grants.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The grants route now loads ongoing and scheduled grants without resolving legacy grantor users. The grants page displays the IdP subject or Unset and uses numeric grant IDs for row identity.

Changes

Telegram grant loading and display

Layer / File(s) Summary
Grant data loading
src/features/telegram/grants.functions.ts, src/routes/dashboard/telegram/grants.tsx
The exported loader returns ongoing and scheduled grants without a grantors field. The route calls the loader and renders a five-column pending skeleton.
Grant table and list display
src/features/telegram/grants-page.tsx, src/features/telegram/user-detail/profile.tsx
The grants page removes resolved grantor data from rows and search. The “Authorized by” cell displays the IdP subject or Unset. The grants table and scheduled grant list use numeric grant IDs for identity.

Priority: ⬇️ Low

Change: Refactor

Merge Risk: ⚪ Minimal · up to 1adbf

No actionable code defect is established. Merge after the required backend deployment.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main changes: grants use IDs, and grantor display uses the IdP subject only.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

2 participants