Filtering items with duplicate IDs on Insert
See original GitHub issueSituation: A list of items is retrieved at load (Active_Items). A subscription fetches the latest item that appears on the server (NewItem). The Insert method within the Subscription adds the latest item to the list, BUT because the latest item is already included in the Active_Items list Svelte generates the following error:
Error: Cannot have duplicate keys in a keyed each
Alas, some Graphql server implementations don’t provide an easy way to limit subscriptions only to mutate events so they’ll start by pulling the latest item. Ideally the Insert method would filter out duplicate ids to avoid this issue.
Thoughts or suggestions? I can probably figure out a workaround with my graphl server (Dgraph) but thought I’d mention the challenge here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16
Top Results From Across the Web
How to filter duplicate id products taking in consideration other ...
As for your second question, map will eliminate the duplicate keys values, keeping only last inserted value of the same key. Remember that...
Read more >Filter for unique values or remove duplicate values
In Excel, there are several ways to filter for unique values—or remove duplicate values: To filter for unique values, click Data > Sort...
Read more >Filter for Duplicates with Conditional Formatting - YouTube
Learn how to filter for duplicates with conditional formatting in Excel. This video is a free sample lesson from my Filters 101 Course....
Read more >How to Filter for Duplicates with Conditional Formatting
In this video you will learn one technique to quickly filter a column for duplicate values.
Read more >How to filter out duplicate IDs leaving only the last duplicate?
The problem is that sometimes, devices are retested within the same dataset, which leads to duplicate values for the ID and wafer columns....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thormuller - that happens here
Well thank you for making the video! It definitely seems like strange behavior. It’s strange that the example doesn’t behave this way (i see the new records get added to the list). Today is a pretty busy day for me so I dont know if I’ll have time to dive into this but you can try adding something similar to the example app to see if you are noticing the same behavior.
Oh, its also probably worth mentioning that along the way in putting together #95 I did encounter an issue which caused me to clean up a rather ugly part of the cache’s implementation. You might want to try pulling that branch down and see if it fixes the problem (this is a guess on my part, it might not be related at all)