UTS: repair broken rest/unit fixtures - #536
Open
owenpearson wants to merge 1 commit into
Open
owenpearson wants to merge 1 commit into
owenpearson wants to merge 1 commit into
Conversation
Replaces a truncated (unsatisfiable) cipher fixture and an invalid-length base64 fixture with valid ones, and refreshes a stale stats fixture and pre-REC1 hostnames. Closes #528 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This branch was successfully deployed
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.
Fixes the four broken fixtures in
uts/rest/unitreported in #528.BLOCKING fixes (made their tests unsatisfiable for a conforming SDK)
1.
presence/rest_presence.md— truncated cipher fixture (RSP5/decode-cipher-channel-7)The old ciphertext
HO4cYSP8LybPYBPZPHQOtuD53yrD3YV3NBoTEYBh4U0=decodes to 32 bytes (16-byte IV + a single AES-CBC block) — one block short of holding any 17-byte-plus PKCS#7-padded plaintext, so it can never decrypt/unpad cleanly. Replaced with the full 48-byte interop ciphertext fromably-commontest-resources/crypto-data-128.json(line 41), corrected the comment to{"example":{"json":"Object"}}, and changed the type-only assertion to assert the decrypted value.Derivation/validation: with the fixture's own key
WUP6u0K7MXI5Zeo0VppPwg==, the new ciphertext is 48 bytes (multiple of 16), its first 16 bytes equal thecrypto-data-128.jsoniv, and AES-128-CBC decrypt + PKCS#7 unpad yields{"example":{"json":"Object"}}(pad byte0x03). Verified locally withcryptography.2.
encoding/message_encoding.md— invalid base64 fixture (RSL6b/unrecognized-encoding-preserved-0)The old payload
encrypted-data-herehas 17 alphabet chars (≡1 mod 4) — a residue class no base64 string can occupy, so the base64 decode the test asserts can never succeed. Replaced withZW5jcnlwdGVkLWRhdGEtaGVyZQ==(base64 ofencrypted-data-here) and strengthened the assertion to check the decoded bytes. Added a separate RSL6b failure-branch test (invalid-base64-preserved-1) with a deliberately invalid payload (@@@invalid@@@) asserting the message is delivered with the last successful decoding —dataunchanged andencoding == "custom-encryption/base64"— which previously had no coverage inuts/rest/unit.Validation:
ZW5jcnlwdGVkLWRhdGEtaGVyZQ==has length 28 (≡0 mod 4), decodes toencrypted-data-here, and round-trips.@@@invalid@@@has 7 alphabet chars (≡3 mod 4) and fails strict RFC4648 decode.Cosmetic fixes (tests already pass; fixtures were stale)
3.
stats.md— pre-2.1 stats shape (RSC6a/returns-paginated-stats-0)Replaced the deleted
allnested-counter blocks with the TS12rentriesDict<String, Int>map and added assertions onentriesso TS12r is actually exercised (it previously had no unit coverage).4.
types/options_types.md— pre-REC1 hostnames (TO/endpoint-affects-host-0)Updated the "Expected Rest Host" table to the REC1a/REC1b4 forms:
main.realtime.ably.net,test.realtime.ably.net,custom-env.realtime.ably.net.Files changed
uts/rest/unit/presence/rest_presence.mduts/rest/unit/encoding/message_encoding.mduts/rest/unit/stats.mduts/rest/unit/types/options_types.mdNo
specifications/change required.Merge order
PR 4 of 7. Merge after the publish-body PR (shares
encoding/message_encoding.md) and coordinate with the presence PR (sharespresence/rest_presence.md).Closes #528
🤖 Generated with Claude Code