-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
SvelteSet: Array.from(set) contains X within it while set.has(X) returns false #14827
Comments
Looking at the code for In svelte/packages/svelte/src/reactivity/set.js Lines 137 to 139 in 7f8acb8
And in svelte/packages/svelte/src/reactivity/set.js Lines 151 to 153 in 7f8acb8
Could it be that that's the possible reason for the bug? |
Keys just call values that read the version so that's not the problem. We do need a reproduction because we can't know how you are using this or what the actual code is (maybe you are calling something else which is the problem). The ideal would be a minimal reproduction and that would mean you should start from your code, try to understand with which input it fail, and try to make the minimal version of your code that still make the bug error (without any business logic from your part). But if you can't at least a repl with your code and a step to reproduce is kinda required for us to even begin to take a look |
@paoloricciuti yeah, I get it, but don't even have a clue as to what I need to do to reproduce it in our codebase, less so about how to minimize it.
Can you, please, take a look at the PRs I've mentioned here and just take a guess if they could have affected it somehow? I know I am asking for needle in the haystack, but even slightest tip would be helpful. Or maybe there is something I can check within the |
The point is: it could be...but if we don't have the full picture of how you use it and the exact code could be something completely different and we might spend hours trying to find this issue while the solution might have been obvious with an actual reproduction. I would say the very minimum would be to have the actual code and all the instances on how it's used (that would still be kinda of mess but at least possibly doable) |
It seems like we found what the root issue was and it's indeed not related to svelte. Apologies for taking your time |
What it was (I'm a curious cat 😺) |
We were receiving int64 number in json instead of int64 number converted to string. It'd be difficult to explain how everything was affected exactly. The funny thing here is that since we are a real time application we are receiving updates. So while I was looking at the set and running some checks in the console I've received correct data. So I was checking old values against new values and that's why the mismatch. Fortunately right after I wrote my last comment my coworker also got the same bug and we were able to investigate it again in his console :) |
Glad it worked out (and props to you for working on Christmas Eve 😁) |
Describe the bug
In our project we have following code
Recently (maybe around a week ago) we've started getting occasional bugs in UI. They are really sporadic, but when I caught one myself I've found that when I do
foo.itemIds
in console, I seesignificantId
in there, but if I callfoo.itemIds.has(foo.significantId)
then it returns false. Then leads tothis.bar
being calculated incorrectly and hence UI bug.Reproduction
It seems like this bug is happening quite rarely and so far I have no idea how even to approach reproduction. Would gladly accept any advice on how to arrive there.
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: