-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Handle bigint in useQuerySubscription #4315
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e22da96:
|
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@riqts thoughts on this PR? Is there anything process-wise I need to do before I get a review? e.g. I'm happy to finish implementing additional unit tests. |
Haha, I think unfortunately just nothing moves fast in volunteer work. Realistically the primary people who are fully tuned in to this area of the codebase are @phryneas or @markerikson as they wrote the code here and are most familiar with its intentions. But unfortunately I think they have been mega busy and there is a decent amount of cognitive load they have to take on for this particular fix. The value vs effort for this particular fix probs just doesn't feel great with the workload. I will try add some context in the issue of the surrounding code so it's easier for the reviewers to engage with the PRs. Potentially this PR itself might be preferred if instead of exposing a replacer it just handled potential incoming bigints within the |
Yeah, to be frank, I've been otherwise occupied with personal stuff for much of this year and haven't had mental bandwidth to do meaningful RTK work (either myself or reviewing actual code PRs). I've seen this PR, I'm very aware of it, but can't give an immediate timeline when I'll have the bandwidth to think through this one. |
[non-technical aside] The major pressures I'm feeling are: (1) I just don't know what the expectations are when contributing (how much I should carry water for the change myself, how much to wait for helpful context from others, etc.) and (2) I'm a little afraid that I will drop context over time, and would feel disappointed (at myself) for not helping to finalize and land this change if it pages out of my working memory. That sense of urgency is a matter of personal convenience and takes a back seat to maintainer needs. @riqts happy to create an alternative PR that handles |
One more idea would be to just re-implement
The main downside is code duplication -- but that should be easy to cleanup later for somebody with more context (it punts the decision of spreading the change everywhere vs. introducing a configuration parameter). |
from memory I don't think we deserialize the results of serializeQueryArgs - it's only used to compare equality of two values (for example, creating a cache key) we keep hold of the original value for things like refetching so there's no need to deserialize |
As suggested; updated to the simplest thing that can work (and added unit test for |
(.. and updated the PR description to match the new code ...) |
Okay, finally swinging back to this (had an evening where I had both time and mental energy to chew through a bunch of open PRs). Thanks for the work here, and for putting up with the delay! |
fixes #4279
Handles query arg values that include
bigint
s while retaining behavior of always initiating refetch (even when user-suppliedserializeQueryArgs
doesn't change). This is an alternative proposed solution from #4297 -- which fixesbigint
errors but diverges refetching behavior.Note: this changes behavior for all callers of
defaultSerializeQueryArgs
; which should be safe if the library doesn't try to re-serialize the args anywhere. It may result in slightly surprising behavior for consumers (a potentially unexpected default serialization of bigint values) - but since it currently breaks hard with an exception for those use cases, unlikely to be a breaking change for anybody.