Skip to content

Conversation

@jog1t
Copy link
Contributor

@jog1t jog1t commented Nov 3, 2025

Closes FRONT-873

@vercel
Copy link

vercel bot commented Nov 3, 2025

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

Project Deployment Preview Comments Updated (UTC)
rivet-inspector Error Error Nov 3, 2025 7:30pm
3 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
rivet-cloud Ignored Ignored Nov 3, 2025 7:30pm
rivet-site Ignored Ignored Preview Nov 3, 2025 7:30pm
rivetkit-serverless Skipped Skipped Nov 3, 2025 7:30pm

Copy link
Contributor Author

jog1t commented Nov 3, 2025

@claude
Copy link

claude bot commented Nov 3, 2025

Code Review

Summary

This PR changes the Changelog component from using useSuspenseQuery to useQuery, making the changelog fetch non-blocking. This is a good improvement that prevents the changelog from blocking the app's initial render.

✅ Positive Aspects

  1. Proper Error Handling: The change correctly handles loading, error, and empty data states by returning early with the children wrapped in a Slot component with the ping indicator hidden.

  2. User Experience Improvement: By making this non-blocking, the app will load faster and won't be delayed if the changelog service is slow or unavailable.

  3. Graceful Degradation: The component gracefully falls back to showing the trigger without the changelog functionality when data is unavailable.

  4. Consistent UI: The early return maintains the same className behavior to hide the ping indicator when there's no data.

🔍 Potential Issues

  1. Optional Array Access Without Safety Check: On line 149 (in the updated code), there's code that accesses data[0]:

    setLast(data[0].published);

    While there's a check for data.length === 0 earlier in the function at line 123, this code path is only reached after that check, so data[0] should be safe. However, the logic could be clearer.

  2. Missing data in Content: On line 164, data[0] is accessed again:

    content={<ChangelogEntry {...data[0]} isNew={hasNewChangelog} />}

    TypeScript might complain here since data could theoretically be undefined despite the early return check. Consider adding a type assertion or non-null assertion if TypeScript raises issues.

💡 Suggestions

  1. Loading State: Consider showing a loading skeleton or indicator while the changelog is loading, rather than just hiding the ping. This would improve perceived performance.

  2. Error Logging: Consider logging errors to help with debugging when the changelog fails to load.

  3. Stale Data Handling: The query has a 1-hour stale time. Consider if the component should show stale data while refetching in the background using keepPreviousData or similar React Query options.

🧪 Testing Considerations

  • No tests exist for this component (checked for changelog.test.* and changelog.spec.*)
  • Consider adding tests for:
    • Loading state behavior
    • Error state behavior
    • Empty data behavior
    • New changelog detection logic
    • LocalStorage interaction

🔒 Security

No security concerns identified. The component fetches from a hardcoded URL and doesn't handle user input directly.

⚡ Performance

The change improves performance by not blocking rendering on the changelog fetch. The query already has appropriate caching (1 hour stale time) configured in changelogQueryOptions() at frontend/src/queries/global.ts:41.

Verdict

Approved ✅ - This is a solid improvement that makes the changelog fetch non-blocking. The implementation is mostly sound, with only minor suggestions for improvement around error handling and loading states.

@jog1t jog1t marked this pull request as ready for review November 3, 2025 19:31
@linear
Copy link

linear bot commented Nov 3, 2025

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 3, 2025

Graphite Automations

"Test" took an action on this PR • (11/03/25)

1 assignee was added to this PR based on Kacper Wojciechowski's automation.

Base automatically changed from 11-03-fix_fe_remove_stickiness_of_headers to graphite-base/3306 November 6, 2025 17:53
@jog1t jog1t merged commit a30948b into graphite-base/3306 Nov 6, 2025
6 of 10 checks passed
@jog1t jog1t deleted the 11-03-fix_fe_make_changelog_non_blocking_resource branch November 6, 2025 17:53
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