Repository navigation
UTS: repair broken rest/unit fixtures - #536
Open
owenpearson wants to merge 5 commits into
Open
owenpearson wants to merge 5 commits into
owenpearson wants to merge 5 commits 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>
The invalid-base64-preserved-1 test asserted that an '@@@invalid@@@' payload is detected as invalid base64. Whether RSL6b requires a strict base64 decoder is an open question: ably-js on Node decodes any string without error. Replace it with RSL6b's own example, an encrypted message received on a channel with no cipher, which every SDK handles the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TO3k2's restHost (optional, deprecated) defaults to the REC1a primary domain, main.realtime.ably.net, per the ClientOptions IDL; the table still showed the pre-REC1 rest.ably.io. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#507 fixes the same truncated RSP5g cipher fixture. Use its hunk byte for byte so the two PRs merge cleanly in either order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#508 replaces the same pre-2.1 RSC6a stats fixture with a superset of this change (schema, appId, intervalTime and the TS12 header). Matching it byte for byte would carry its Time( constructor where the file uses DateTime(, and any difference on those lines conflicts whichever PR merges second, so drop this PR's stats.md change and let #508 fix it. Co-Authored-By: Claude Opus 5.5 <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 broken fixtures in
uts/rest/unitreported in #528. The stats fixture is left to #508 (see below).Fixes that made tests unsatisfiable
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 any 17-byte-plus PKCS#7-padded plaintext, so it can never decrypt and 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 asserted the decrypted value instead of only its type.#507 fixes the same fixture, so this hunk is now byte-identical to #507's and the two merge cleanly in either order.
Validation: with the fixture's own key
WUP6u0K7MXI5Zeo0VppPwg==, the new ciphertext is 48 bytes, its first 16 bytes equal thecrypto-data-128.jsoniv, and AES-128-CBC decrypt + PKCS#7 unpad yields{"example":{"json":"Object"}}(pad byte0x03).Fixes to RSL6b tests
2.
encoding/message_encoding.md:RSL6b/unrecognized-encoding-preserved-0The payload
encrypted-data-hereis replaced withZW5jcnlwdGVkLWRhdGEtaGVyZQ==(standard, padded base64 ofencrypted-data-here), and the assertion now checks the decoded bytes. #528 called the old payload undecodable for any SDK. That was too strong: it is valid unpadded base64url. But it relies on the decoder accepting the URL-safe alphabet without padding, so a standard padded payload is the safer fixture.3.
encoding/message_encoding.md: newRSL6b/no-cipher-delivers-encrypted-1Covers RSL6b's own worked example. A message with encoding
utf-8/cipher+aes-128-cbc/base64(item 0 ofcrypto-data-128.json) is received on a channel with no cipher. The test asserts that the message is delivered with the base64 decoded, the payload still encrypted (binary),encoding == "utf-8/cipher+aes-128-cbc", and an error logged.An earlier revision of this PR tested the invalid-base64 branch with an
@@@invalid@@@payload. That test fails on ably-js on Node, whose base64 decoder never fails. Whether RSL6b requires strict base64 validation is a question for the spec owners, so this PR no longer takes a position on it and tests the worked example instead.Stale fixtures (tests already passed)
4.
types/options_types.md: pre-REC1 hostnamesTO/endpoint-affects-host-0: the "Expected Rest Host" table now uses the REC1a/REC1b4 forms:main.realtime.ably.net,test.realtime.ably.net,custom-env.realtime.ably.net.TO3/client-options-attributes-0: therestHostdefault is now"main.realtime.ably.net"(theClientOptionsIDL default for TO3k2, the REC1a primary domain), not"rest.ably.io".5.
stats.md: left to #508#508 replaces the pre-2.1
RSC6a/returns-paginated-stats-0fixture with the TS12rentriesshape. Its change is a superset of what this PR had. This PR no longer touchesstats.md, so the two PRs don't conflict. With this PR alone, #528's stats item is not fixed; #508 fixes it.Files changed
uts/rest/unit/presence/rest_presence.mduts/rest/unit/encoding/message_encoding.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). Merges cleanly with #507 and #508 in any order (checked locally against currentmain).Part of #528. #528 can be closed once this PR and #508 are both merged.
🤖 Generated with Claude Code