Feat/hasclaim cache - #147
Open
oscar24357 wants to merge 9 commits into
Open
Conversation
|
@oscar24357 is attempting to deploy a commit to the psalmuel01's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@oscar24357 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
Author
|
hello boss, can you please assign this point to me on drips, thank you |
Contributor
Author
|
Hello maintainer, good evening. Can you please award this points to me on drips..thank you |
Contributor
Author
|
can you give please give me the points to this issue |
Contributor
Author
|
hello boss, can you award this points to me on drips please, thank you |
Collaborator
|
this is failing and greptile score is 1 |
Collaborator
|
@oscar24357 rebase and fix conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #129
Greptile Summary
This PR adds an opt-in in-memory cache to
StellarCred.hasClaim, a newinvalidateAPI, full i18n support across all frontend pages vianext-intl, aLangSwitchercomponent, and a tag-driven release workflow. The SDK cache itself is well-designed and the test coverage is thorough, but the implementation was merged with numerous incomplete edits throughout the codebase.index.ts):invalidate's closing brace is missing so the oldconfigureis parsed as a nested function inside it; twoStellarCrednamespace exports exist on back-to-back lines;trustedIssuersis silently dropped in the cached code path.holder,issuer,verify,apps,apps/[id],layout,SiteNav): Every file has at least one duplicate import, unclosed JSX expression, or duplicate JSX prop — all of which are TypeScript compile errors that prevent the app from building.verify/page.tsx: Newly addedreturnUrlIsValid/returnLabelcomputation accesseswindow.location.origindirectly in the component body without an SSR guard, crashing server-side rendering of the/verifyroute.Confidence Score: 1/5
Not safe to merge — the frontend does not compile and the SDK does not compile.
Every changed frontend page and the SDK itself contain TypeScript compile errors (duplicate imports, unclosed JSX, duplicate identifier declarations). The app cannot be built or deployed in this state. Additionally, the
/verifypage will crash server-side rendering on every request due to an unguardedwindowaccess at render time.Files Needing Attention: All changed frontend pages need merge-artifact cleanup;
frontend/packages/sdk/src/index.tsneeds itsinvalidatefunction closed and the two duplicateStellarCredexports consolidated;frontend/app/verify/page.tsxneeds thewindow.location.originrender-time access guarded.Important Files Changed
hasClaimcaching,invalidate, andConfigureOptionsinterface — but the refactor left theinvalidatefunction body unclosed (oldconfigureis nested inside it), twoStellarCredexport declarations,trustedIssuerssilently dropped from cached path, and dead code afterreturn result.configureoptions — good coverage of the intended behaviour, but tests cannot run because the SDK itself does not compile.useEffect/useRef/useState(already imported via the existingSuspenseline), and two JSX elements have duplicatetitle/subtitleprops — both are TypeScript compile errors.redirectAfterIssuepartially refactored, but the function body has two unclosed nestedifblocks, a separate unclosed JSX expression, and a new render-timewindow.location.originaccess without an SSR guard that crashes server-side rendering of the page.LocaleProviderwrapping the app, but the new provider tree was inserted without removing the originalToastProvider/WalletProvidersubtree, rendering the nav, main, and footer twice and omittingNetworkBannerand toasts from the new tree.git push origin HEAD:mainfrom a detached-HEAD tag checkout will fail whenmainhas branch protection, leaving releases in a half-finished state.LangSwitcherto the nav, butIconBook2andIconCodeare imported twice (new partial import on line 7 and the original full import on line 9), causing TypeScript to reject the file.commitlintjob to the CI pipeline that lints PR commit messages against conventional commits — straightforward and correct.Sequence Diagram
sequenceDiagram participant App as Calling App participant SDK as @stellarcred/sdk participant Cache as In-Memory Cache participant RPC as Stellar RPC App->>SDK: hasClaim(wallet, claimType, opts) SDK->>SDK: buildCacheKey(wallet, claimType, minThreshold) alt "cacheEnabled && cache hit" SDK->>Cache: get(cacheKey) Cache-->>SDK: CacheEntry (value, expiresAt) SDK-->>App: cached boolean (no RPC) else cache miss or disabled alt minThreshold set SDK->>RPC: readCheckClaim(wallet, claimType, minThreshold) else binary claim SDK->>RPC: readIsVerified(wallet, claimType) end RPC-->>SDK: result alt cacheEnabled SDK->>Cache: "set(cacheKey, {value, expiresAt})" end SDK-->>App: result end App->>SDK: invalidate(wallet?, credentialType?) SDK->>Cache: delete matching entriesReviews (7): Last reviewed commit: "Merge branch 'main' into feat/hasclaim-c..." | Re-trigger Greptile