Skip to content

revert: remove exception for base subgraph that wasn't synced - #993

Draft
dan13ram wants to merge 4 commits into
stagingfrom
feat/revert-exception-base-subgraph
Draft

revert: remove exception for base subgraph that wasn't synced#993
dan13ram wants to merge 4 commits into
stagingfrom
feat/revert-exception-base-subgraph

Conversation

@dan13ram

@dan13ram dan13ram commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Bug Fixes

    • Standardized proposal and dashboard data loading across supported networks.
    • Improved vote timestamp accuracy by using on-chain event timestamps when available.
    • Corrected proposal version ordering and update-period value handling.
  • Enhancements

    • Proposal data now includes update status, version, and replacement information where available.
    • Simplified proposal actions and metadata processing for more consistent results.

@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
testnet-nouns-builder Ready Ready Preview Aug 3, 2026 12:20pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
nouns-builder Ignored Ignored Aug 3, 2026 12:20pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 42637cbe-eb68-40e2-9c2c-82cf247acef3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The 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.

Changes

Proposal query standardization

Layer / File(s) Summary
GraphQL proposal contract
packages/sdk/src/subgraph/fragments/Proposal.graphql, packages/sdk/src/subgraph/queries/*Updatable.graphql, packages/sdk/src/subgraph/queries/proposalVersions.graphql
The proposal fragment adds update and replacement metadata. Updatable proposal queries and fragments are removed. Version ordering uses updateCount.
SDK standard query paths
packages/constants/src/subgraph.ts, packages/sdk/src/subgraph/requests/*Query.ts, packages/sdk/src/subgraph/queries/*Updatable.graphql
The SDK removes chain capability checks and always uses standard dashboard, proposal, proposal-version, and proposal-list queries. Update-period values are numeric or undefined.
Web proposal metadata flow
apps/web/src/pages/dao/[network]/[token]/vote/[id].tsx
The vote page always calls proposalOGMetadata and reads data.replacedBy.proposalNumber directly.
Vote status timing
packages/proposal-ui/src/components/ProposalActions/VoteStatus/VoteStatus.tsx
updateDeadline no longer accepts null. Vote events use blockTimestamp when available and otherwise use the current Unix timestamp.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided, so the required change summary, motivation, review notes, type, and checklist are missing. Add a description that completes the template sections, including the change summary, motivation, review notes, change type, and checklist.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: reverting the exception for the unsynced base subgraph.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/revert-exception-base-subgraph

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/proposal-ui/src/components/ProposalActions/VoteStatus/VoteStatus.tsx (1)

97-99: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add tests for both timestamp paths.

Extend VoteStatus.test.tsx to cover logs with blockTimestamp and logs without it. Assert the persisted ProposalVote.timestamp uses 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

📥 Commits

Reviewing files that changed from the base of the PR and between ff9820c and c9e6951.

⛔ Files ignored due to path filters (1)
  • packages/sdk/src/subgraph/sdk.generated.ts is excluded by !**/*.generated.*
📒 Files selected for processing (16)
  • apps/web/src/pages/dao/[network]/[token]/vote/[id].tsx
  • packages/constants/src/subgraph.ts
  • packages/proposal-ui/src/components/ProposalActions/VoteStatus/VoteStatus.tsx
  • packages/sdk/src/subgraph/fragments/Proposal.graphql
  • packages/sdk/src/subgraph/fragments/ProposalDetailUpdatable.graphql
  • packages/sdk/src/subgraph/fragments/ProposalUpdatable.graphql
  • packages/sdk/src/subgraph/queries/daosForDashbaordUpdatable.graphql
  • packages/sdk/src/subgraph/queries/proposalOGMetadataUpdatable.graphql
  • packages/sdk/src/subgraph/queries/proposalUpdatable.graphql
  • packages/sdk/src/subgraph/queries/proposalVersions.graphql
  • packages/sdk/src/subgraph/queries/proposalVersionsUpdatable.graphql
  • packages/sdk/src/subgraph/queries/proposalsUpdatable.graphql
  • packages/sdk/src/subgraph/requests/dashboardQuery.ts
  • packages/sdk/src/subgraph/requests/proposalQuery.ts
  • packages/sdk/src/subgraph/requests/proposalVersionsQuery.ts
  • packages/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

Comment on lines +24 to +31
PUBLIC_DEFAULT_CHAINS.map((chain) =>
SDK.connect(chain.id)
.daosForDashboard({
user: memberAddress.toLowerCase(),
first: 30,
})
.then((x) => ({ ...x, chainId: chain.id }))
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 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.

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