Skip to content

Idempotent IDs not generated for annotations or batch publish (RSAN1c4, RSC22d) #2195

@paddybyers

Description

@paddybyers

Spec points

  • RSAN1c4: "If `idempotentRestPublishing` is enabled and the annotation has an empty `id`, the SDK should generate a base64-encoded random string, append `:0`, and set it as the `Annotation.id`."
  • RSC22d: "If `idempotentRestPublishing` is enabled, then RSL1k1 should be applied (to each `BatchPublishSpec` separately)."

Observed behaviour

Only `RestChannel.publish()` generates idempotent IDs (via the `allEmptyIds()` / `idempotentRestPublishing` code path). Neither `RestAnnotations.publish()` nor `batchPublish()` generates them — messages are sent exactly as provided by the caller, with no `id` fields added.

Failing tests (2)

Test Expected Actual
`RSAN1c4 - idempotent ID generated` Annotation `id` matches `:0` pattern `id` is undefined
`RSC22d - batch publish generates idempotent IDs` Messages in batch have generated `id` fields `id` property absent

Reproduction

```bash
RUN_DEVIATIONS=1 npx mocha --grep "RSAN1c4" test/uts/rest/channel/annotations.test.ts
RUN_DEVIATIONS=1 npx mocha --grep "RSC22d" test/uts/rest/batch_publish.test.ts
```

From PR #2191, branch `uts-rest`.

┆Issue is synchronized with this Jira Task by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. It's clear that this does need to be fixed.uts-issueIssues raised there there is an apparent discrepancy between this library and the UTS tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions