AgentJS throws error if declarations are outdated


We have 1000s of canisters hosted in the subnet. And it takes hours to update all of them. A problem we encountered while going through the whole process was to decide when does the frontend update?

Because we’re running into some weird behaviour. While the canisters are being updated our frontend starts throwing errors like this:

Basically, agentJS completely fails the requests because of a required field error. Updating the frontend then with the latest declarations does make the error go away after some time.

But this behaviour is weird, as I haven’t been able to reproduce this locally.

Any tips why would this happen? Is it because maybe, because of the change in response data structure and if not all of the canisters have been updated agentJs might consider some responses broken?

I asked around a little bit and if I understood correctly, this is because of the JS candid library doing something wrong. Not something on your end. There are plans to start addressing it, but I don’t have any good solution for you for now :frowning_face:

1 Like