-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load contributions at set up #2606
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
WalkthroughThe pull request introduces changes to the entity fetching and subscription mechanism in the client-side application. In the Changes
Sequence DiagramsequenceDiagram
participant Setup as Setup Function
participant EntityFetcher as Entity Fetcher
participant LoadingState as Loading State Manager
Setup->>LoadingState: Set hyperstructures loading to true
Setup->>EntityFetcher: Fetch Epoch, Progress, Contribution entities
EntityFetcher-->>Setup: Return fetched entities
Setup->>LoadingState: Set hyperstructures loading to false
Possibly related PRs
Suggested reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
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)
client/src/dojo/setup.ts (1)
149-180
: Ensure consistent error handling for Hyperstructure fetching.The
getEntities
call for Hyperstructure models is wrapped in a.finally()
block, which correctly resets theLoadingStateKey.Hyperstructure
state. However, unlike other blocks using atry
/finally
approach, there's nocatch
capturing explicit errors for logging or user feedback. It would be beneficial to maintain consistency by adding an optionaltry
/catch
block here for better traceability and debugging in case of errors, as is done in other parts of this file.setLoading(LoadingStateKey.Hyperstructure, true); try { await getEntities( ... ); } catch (error) { + console.error("Hyperstructure fetching failed", error); } finally { setLoading(LoadingStateKey.Hyperstructure, false); }
// useEffect(() => { | ||
// const fetch = async () => { | ||
// try { | ||
// setLoading(LoadingStateKey.Hyperstructure, true); | ||
// console.log("AddToSubscriptionStart - 4"); | ||
// await Promise.all([ | ||
// debouncedAddHyperstructureSubscription(dojo.network.toriiClient, dojo.network.contractComponents as any, () => | ||
// setLoading(LoadingStateKey.Hyperstructure, false), | ||
// ), | ||
// ]); | ||
// } catch (error) { | ||
// console.error("Fetch failed", error); | ||
// } finally { | ||
// // Ensure loading states are reset even if there's an error | ||
// setLoading(LoadingStateKey.Hyperstructure, false); | ||
// } | ||
// }; | ||
|
||
// fetch(); | ||
// }, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remove commented-out subscription logic if no longer needed.
The entire effect responsible for subscribing to hyperstructure updates is commented out. If this subscription is fully replaced by the logic in setup.ts
, removing this code, rather than commenting it out, helps maintain clarity and reduce clutter. If re-enabling is still under consideration, provide a clear comment or TODO indicating why it's currently disabled and under what conditions it might be restored.
You are out of MentatBot reviews. Your usage will refresh December 30 at 08:00 AM. |
Summary by CodeRabbit