Repository navigation
Fix what live Dataverse requests showed: batch decoding, $ref addresses and replacing casts - #440
Merged
Merged
Conversation
…es and replacing casts Batch answers decoded their framing as UTF-8 and their text parts byte by byte, which corrupted file content and non-ASCII text; framing is now read as bytes and text parts as UTF-8. Dataverse takes $ref addresses only absolute, answers no address for a row created through a navigation property and refuses PATCH through one, so the descriptions say so and updateRelatedRow is gone. replaceRow and replaceRelatedRow take a type cast, as Dataverse accepts PUT on a cast address. Answer headers are read as UTF-8, as Dataverse sends file names, and single uploads are documented as application/octet-stream.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Running every write path of the Dataverse template against a real environment exposed a few bugs.
Fixes
batchanswers were corrupted. The multipart framing was decoded as UTF-8 and each text part byte by byte, so non-ASCII text such asMüllerand binary file content came back mangled. The framing is now read as bytes, and text parts are decoded as UTF-8. A new test covers a UTF-8 JSON part next to a binary part; it fails with the old decoding.$refaddresses must be absolute. Dataverse refusescontacts(<id>)inassociateRowsandsetReference("A relative URI value … was specified"). The descriptions now ask forhttps://<environment>/api/data/v9.2/contacts(<id>).updateRelatedRowremoved. Dataverse answersPATCHthrough a navigation property with 405.replaceRowandreplaceRelatedRowtaketype. Dataverse acceptsPUTon a cast address such as…/Attributes(LogicalName='x')/Microsoft.Dynamics.CRM.StringAttributeMetadata. That is the address a definition read with a cast comes from, and such a definition carries no@odata.type.Prüfbericht.txt).createRelatedRowanswers no address for the new row, andreturn=representationfails there with a Dataverse server error.application/octet-stream;text/plaingets 415.Live run
All 30 checks passed against a Developer environment, and every test row and table was removed afterwards. The run covered:
OData-EntityId,$expandand deep insert),not_modified, single columnsnextLink,$count,$refRangebatch: change sets with Content-ID references, rollback, file bytes