Skip to content

Parallelize and correctly cache dashboard Server Component data fetches #8

Closed

Description

@chonilius

Problem

Every dashboard route (src/app/dashboard/contributor/page.tsx, .../maintainer/page.tsx, .../sponsor/page.tsx) is a Server Component that, per the README's architecture diagram, fetches from the backend with mock fallback. Given each dashboard likely needs multiple distinct resources (e.g. sponsor needs funded bounties + budget summary + activity; contributor needs claimed bounties + reputation + recommendations), and src/lib/api.ts's fetchers are independent async functions with no batching, there's a strong likelihood of an unoptimized sequential fetch waterfall (each await fetch... blocking the next) rather than a Promise.all parallelization — and no visible use of Next.js 16's caching/fetch dedupe features (cache: "no-store" is hardcoded in request(), defeating Next's request memoization benefits entirely for repeated calls in one render pass, e.g. if /users is fetched by both fetchReputationByUsername and something else in the same render).

Why this is hard

  • Requires reading and mapping the actual data dependencies of all three dashboard pages plus ActivityList.tsx/DashboardShell.tsx to determine which fetches are independent (parallelizable) versus genuinely sequential (one depends on another's result, e.g. reputation lookup depends on resolving a user id first, as seen in fetchReputationByUsername's two-step /users then /reputation/:id call).
  • The hardcoded cache: "no-store" in request() was presumably a deliberate choice (financial/escrow data shouldn't be stale) — you need to determine per-resource whether that's actually correct or overly conservative (e.g. does a sponsor's list of repos need to bypass cache on every render, or only budget/balance figures?), and apply Next.js 16's fetch caching/revalidation options surgically rather than uniformly disabling caching.
  • Introducing Promise.all around independent fetches changes error semantics: currently each fetchX independently catches and falls back, so partial failure is naturally isolated; verify a naive Promise.all refactor doesn't change a single resource's failure into a whole-page failure (it won't, if each promise's own try/catch is preserved, but this needs to be explicitly verified with a test, not assumed).
  • Must measure and report an actual before/after (e.g. via Next.js build/dev network waterfall or server timing logs) since "waterfall" is a claim that needs verification per page, not a blanket assumption — some pages may already be fine.

Scope

  • Profile all three dashboard pages' current fetch waterfalls (document findings in the PR).
  • Refactor genuinely independent fetches to run concurrently via Promise.all/Promise.allSettled while preserving per-resource fallback isolation.
  • Review and apply appropriate Next.js fetch caching/revalidation per resource type instead of blanket no-store, justifying each choice.
  • Add before/after timing evidence in the PR description.

Acceptance criteria

  • Documented reduction in server-side time-to-first-byte / total fetch duration for at least the sponsor dashboard (the most data-heavy per the README).
  • No change in fallback behavior when an individual resource's backend call fails.

Activity

  1. added
    very hard
    performance
    architecture
    on Jul 15, 2026
  2. added
    GrantFox OSS
    Maybe Rewarded
    Official Campaign | FWC26
    on Jul 15, 2026
  3. added
    Stellar Wave
    on Aug 25, 2026
  4. devgodfreytem commented on Aug 25, 2026

    @devgodfreytem
    Contributor

    @devgodfreytem has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hello maintainer, i would love to work on this issue.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @devgodfreytem to this issue.

  5. drips-wave commented on Aug 25, 2026

    @drips-wave

    Congratulations, @devgodfreytem! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @devgodfreytem: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  6. drips-wave commented on Aug 25, 2026

    @drips-wave

    This issue has been completed by @devgodfreytem as part of the Stellar Wave Program's 8th Wave 🥳

    😎 @devgodfreytem: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  7. removed
    Stellar Wave
    on Oct 15, 2026
  8. added
    Stellar Wave
    on Oct 15, 2026
  9. removed
    Stellar Wave
    on Oct 15, 2026
  10. added
    Stellar Wave
    on Oct 15, 2026
  11. removed
    Stellar Wave
    on Oct 15, 2026
  12. added
    Stellar Wave
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSMaybe RewardedOfficial Campaign | FWC26Stellar Wavearchitectureperformancevery hard

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions