-
Notifications
You must be signed in to change notification settings - Fork 20
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: add unique id to app created page #257
Conversation
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.
Nice 🙌
Did you try passing |
}); | ||
// Adding a unique id prevents https://github.com/getAlby/hub/issues/252 | ||
navigate( | ||
`/apps/created?id=${createAppResponse.pairingPublicKey}${app ? `&app=${app.id}` : ""}`, |
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.
It was already here, but why is there a conditional here? this seems wrong?
Also, the pairingPublicKey
should be unique per app
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.
sorry, I completely misread this. I am wrong 😢
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.
but it's weird, the navigation state should work. And it seems like it's not
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.
something is wrong here (not sure what)
@im-adithya @reneaaron I found how to consistently reproduce the issue:
Step 3. Will lead to this bug. The pubkey is different for each app, but SQLITE is reusing app IDs rather than properly auto-incrementing. We fetch events by pubkey from the API, but internally we query by app ID. And for some reason when we delete apps, the request_events are not deleted. So this PR does actually not fix the issue, and there's nothing wrong with the routing (which passes different state each time) |
For some reason the foreign key on delete constraint is not working
|
Fixes #252
State seems to be persisted in browsers history, we fix that by using a unique URI for every app that has been created.