Debugging to user/index.ts in ndk:user namespace / Updated some tests#362
Debugging to user/index.ts in ndk:user namespace / Updated some tests#362digitalbase wants to merge 3 commits intomasterfrom
user/index.ts in ndk:user namespace / Updated some tests#362Conversation
pablof7z
left a comment
There was a problem hiding this comment.
Code Review: Needs Changes
This PR adds useful debug logging to user/index.ts, but has several issues:
Issues
-
biome.json change is unrelated — Disabling
noNonNullAssertionproject-wide should not be bundled with a debugging PR. -
Side-effect in debug log — In
getZapInfo(), the debug statement callsawait this.fetchProfile()BEFORE thePromise.all, which means the profile is fetched twice and thepromiseWithTimeoutwrapper is removed, changing timeout behavior:d("Fetching user Profile and mint event", { profile: await this.fetchProfile(), // <-- fetches profile as side effect }); const [userProfile, mintListEvent] = await Promise.all([ this.fetchProfile(), // <-- fetches again
-
Removed
promiseWithTimeoutwrapper — ThegetZapInfo()method had an optional timeout mechanism that's been removed, which is a behavioral change. -
Import reformatting — Cosmetic changes (removing spaces in destructuring) add noise to the diff.
-
Test changes — Switching from
ndk.getUser()tondk.fetchUser()changes test semantics (sync vs async). These might be intentional improvements but need their own PR context.
Suggestions
- Remove the biome.json change
- Fix the side-effect fetch in the debug log (log the pubkey only, not the profile)
- Keep the
promiseWithTimeoutwrapper - Submit import reformatting separately or not at all
No description provided.