-
Notifications
You must be signed in to change notification settings - Fork 310
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
Fix coreNode error when fetching public data with no user session #802
Comments
@agraebe is this something the DevX team may want to take on soon? |
Hmm, @markmhx can you provide a repo/snippet of code to easily reproduce? Looks like this is an easy fix but not entirely sure what the intention behind this code |
How about this as a snippet? The intention is basically to query a user's public data using their ID without necessarily having a session oneself (e.g. for a public profile). |
It seems like this could be fixed with a |
This breaks the todo-list tutorial to lookup public lists for new users. https://docs.blockstack.org/authentication/building-todo-app#sign-out-and-see-your-public-tasks |
@agraebe It seems this was de-prioritized on the DevX side, correct? It seems like pretty core SDK functionality to me, so I'd suggest taking another look if we can. |
I think this was never prioritized and we got started on the monorepo work in the meantime. @yknl could you take a look, please? maybe we could include this in the monorepo release? |
@yknl what should be the next step for this issue? |
@zone117x how much effort would it be to fix this bug? is this a ~P3? |
@aulneau mind adding your workaround here in the meantime for reference? |
The code snippet I provided is not actually a workaround for this specific issue. |
If an app needs to retrieve data for a particular username without an active user session, might it cobble together a GET query for the data they want, constructing the file's path manually and initiate the request outside of the Stacks.js library somehow?
|
It looks like changing this line https://github.com/blockstack/stacks.js/blob/7915c953d4b7c6a2d8e7a2f3125c449687ff8aac/packages/storage/src/storage.ts#L867 const configuredCoreNode = sessionData.userData?.coreNode || userSession.appConfig.coreNode; should at least fix the error being thrown that Mark first mentioned. @marcosc90 is this something you could take on? |
@reedrosenbluth was this resolved in a particular PR? |
@markmhx my bad, didn't mean to close this |
As first encountered with markmhendrickson/humans#12, I'm getting
TypeError: Cannot read property 'coreNode' of undefined
upon callinggetFile
and reaching: https://github.com/blockstack/blockstack.js/blob/950dc4fc838099835ce0592f245453c770663b84/src/storage/index.ts#L253sessionData.userData
is undefined and throws an error instead of getting to usecaller.appConfig.coreNode
cc @zone117x since he appears to be the last person to touch this part of the code
The text was updated successfully, but these errors were encountered: