fix: service ordering must be alphabetical #781
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #780
Description
As discussed in this forum post service field ordering must be alphabetical or errors will be encountered during deserialization.
Fixes # 780
How Has This Been Tested?
We ran into these problems while building Azle 0.18.0, and our automated tests for services were breaking before introducing this fix. We rely heavily on the JS agent now in Azle 0.18.0 and hundreds of our integration tests pass using this new code. We seem to be the only ones that I know of heavily testing/using Candid services directly, as we've found both the Rust and JS agent bugs for service ordering.
These tests ran on our fork of just the @dfinity/candid package, and I've simply copied the changes into a recently cloned fork of the agent-js.
If you want to see the tests that we've run I can provide links to Azle's example integration tests.
Checklist: