revert: remove exception for base subgraph that wasn't synced - #993
revert: remove exception for base subgraph that wasn't synced#993dan13ram wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe PR removes chain-specific updatable proposal queries and support checks. SDK requests now use standard queries and normalize update-period values. The vote page uses standard metadata. Vote events prefer contract timestamps. ChangesProposal query standardization
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/proposal-ui/src/components/ProposalActions/VoteStatus/VoteStatus.tsx (1)
97-99: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd tests for both timestamp paths.
Extend
VoteStatus.test.tsxto cover logs withblockTimestampand logs without it. Assert the persistedProposalVote.timestampuses Unix seconds in both cases.🤖 Prompt for 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. In `@packages/proposal-ui/src/components/ProposalActions/VoteStatus/VoteStatus.tsx` around lines 97 - 99, Add tests in VoteStatus.test.tsx covering the timestamp assignment in VoteStatus: verify logs with blockTimestamp persist ProposalVote.timestamp using that Unix-seconds value, and logs without blockTimestamp fall back to the current Unix-seconds timestamp.
🤖 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 `@packages/sdk/src/subgraph/requests/dashboardQuery.ts`:
- Around line 24-31: Update the per-chain aggregation around
SDK.connect(...).daosForDashboard to use Promise.allSettled instead of
Promise.all, then retain only fulfilled results and skip rejected chain requests
before constructing the dashboard response. Preserve the existing chainId
enrichment for successful results and the surrounding catch behavior for other
failures.
---
Nitpick comments:
In
`@packages/proposal-ui/src/components/ProposalActions/VoteStatus/VoteStatus.tsx`:
- Around line 97-99: Add tests in VoteStatus.test.tsx covering the timestamp
assignment in VoteStatus: verify logs with blockTimestamp persist
ProposalVote.timestamp using that Unix-seconds value, and logs without
blockTimestamp fall back to the current Unix-seconds timestamp.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 8a327a88-b19c-4b38-ba9a-0b07498ec551
⛔ Files ignored due to path filters (1)
packages/sdk/src/subgraph/sdk.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (16)
apps/web/src/pages/dao/[network]/[token]/vote/[id].tsxpackages/constants/src/subgraph.tspackages/proposal-ui/src/components/ProposalActions/VoteStatus/VoteStatus.tsxpackages/sdk/src/subgraph/fragments/Proposal.graphqlpackages/sdk/src/subgraph/fragments/ProposalDetailUpdatable.graphqlpackages/sdk/src/subgraph/fragments/ProposalUpdatable.graphqlpackages/sdk/src/subgraph/queries/daosForDashbaordUpdatable.graphqlpackages/sdk/src/subgraph/queries/proposalOGMetadataUpdatable.graphqlpackages/sdk/src/subgraph/queries/proposalUpdatable.graphqlpackages/sdk/src/subgraph/queries/proposalVersions.graphqlpackages/sdk/src/subgraph/queries/proposalVersionsUpdatable.graphqlpackages/sdk/src/subgraph/queries/proposalsUpdatable.graphqlpackages/sdk/src/subgraph/requests/dashboardQuery.tspackages/sdk/src/subgraph/requests/proposalQuery.tspackages/sdk/src/subgraph/requests/proposalVersionsQuery.tspackages/sdk/src/subgraph/requests/proposalsQuery.ts
💤 Files with no reviewable changes (8)
- packages/sdk/src/subgraph/fragments/ProposalUpdatable.graphql
- packages/sdk/src/subgraph/fragments/ProposalDetailUpdatable.graphql
- packages/sdk/src/subgraph/queries/proposalsUpdatable.graphql
- packages/sdk/src/subgraph/queries/proposalUpdatable.graphql
- packages/sdk/src/subgraph/queries/proposalOGMetadataUpdatable.graphql
- packages/sdk/src/subgraph/queries/daosForDashbaordUpdatable.graphql
- packages/constants/src/subgraph.ts
- packages/sdk/src/subgraph/queries/proposalVersionsUpdatable.graphql
| PUBLIC_DEFAULT_CHAINS.map((chain) => | ||
| SDK.connect(chain.id) | ||
| .daosForDashboard({ | ||
| user: memberAddress.toLowerCase(), | ||
| first: 30, | ||
| }) | ||
| .then((x) => ({ ...x, chainId: chain.id })) | ||
| ) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Isolate per-chain failures instead of failing the whole dashboard.
This loop aggregates every chain's daosForDashboard call with Promise.all. If one chain's request rejects, for example because that chain's subgraph does not yet support a field in the Proposal fragment, or because of a transient subgraph outage, Promise.all rejects as a whole. The catch block below then returns no dashboard data for every chain, not just the failing one.
Use Promise.allSettled and skip the failed chains instead of failing the entire request.
🛡️ Proposed fix to isolate per-chain failures
- const data = await Promise.all(
- PUBLIC_DEFAULT_CHAINS.map((chain) =>
- SDK.connect(chain.id)
- .daosForDashboard({
- user: memberAddress.toLowerCase(),
- first: 30,
- })
- .then((x) => ({ ...x, chainId: chain.id }))
- )
- )
+ const results = await Promise.allSettled(
+ PUBLIC_DEFAULT_CHAINS.map((chain) =>
+ SDK.connect(chain.id)
+ .daosForDashboard({
+ user: memberAddress.toLowerCase(),
+ first: 30,
+ })
+ .then((x) => ({ ...x, chainId: chain.id }))
+ )
+ )
+ const data = results.flatMap((result) =>
+ result.status === 'fulfilled' ? [result.value] : []
+ )🤖 Prompt for 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.
In `@packages/sdk/src/subgraph/requests/dashboardQuery.ts` around lines 24 - 31,
Update the per-chain aggregation around SDK.connect(...).daosForDashboard to use
Promise.allSettled instead of Promise.all, then retain only fulfilled results
and skip rejected chain requests before constructing the dashboard response.
Preserve the existing chainId enrichment for successful results and the
surrounding catch behavior for other failures.
Summary by CodeRabbit
Bug Fixes
Enhancements