Item with id '2' is already in list

47 views
Skip to first unread message

xacer

unread,
Jul 5, 2023, 10:48:53 AM7/5/23
to desmos-api-discuss
Hi everyone,
When I programmatically add equations to the graph, then the user tries to create another question by clicking below the equation list, I get this error:

Uncaught Error: Item with id '2' is already in list

Shouldn't Desmos check to make sure it's creating a new expression with a unique id?

ja...@desmos.com

unread,
Jul 5, 2023, 1:35:09 PM7/5/23
to desmos-api-discuss
I agree that this appears to be a bug. Thank you for reporting. I have added this issue to our internal tracker.

Some quick testing suggests the bug may have been introduced between API v1.0 and API v1.1, so it has been around for a while.

As a workaround, I'd suggest choosing non-numeric ids for expressions generated through the API to avoid colliding with the calculator's internally generated ids.

xacer

unread,
Jul 10, 2023, 10:47:20 AM7/10/23
to desmos-api-discuss

Hi Jason,

Thanks for your response! I appreciate the continued support of the Desmos API.

My specific use-case is creating a multiplayer version of Desmos. I use the API to sync equations across users, and thus I'm stuck using the auto-generated IDs.
I've worked around this by overriding the event listeners on the page and manually creating new equations with distinct IDs :)
Reply all
Reply to author
Forward
0 new messages