Skip to content

Commit a92939b

Browse files
chore(audience): post-rebase cleanup for main drift
After rebasing feat/audience-web-sdk-demo onto main, four places still referenced the pre-review shape of AudienceError that #2841 changed during review, plus the lockfile carried stale resolutions from before main drifted: - src/cdn.ts: AudienceError now lives in @imtbl/audience-core/errors, not sdk/src/types. Import it from core alongside IdentityType. - README.md: the AudienceError.code union lost 'UNKNOWN' and gained 'VALIDATION_REJECTED' (terminal failure, 2xx with rejected > 0). Update the documented shape to match. - src/cdn.test.ts: the smoke test's fake AudienceError was constructed with code: 'UNKNOWN', which is no longer a valid AudienceErrorCode. Use 'NETWORK_ERROR' which matches the test's status: 0 setup. - pnpm-lock.yaml: reset to main's baseline and reinstall so the only delta is the new esbuild-plugin-replace dev-dep added by the CDN bundle build commit. This avoids the rebase carrying over stale @types/node and peer-context resolutions from before main drifted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 438d023 commit a92939b

4 files changed

Lines changed: 153 additions & 197 deletions

File tree

packages/audience/sdk/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ IdentityType.Passport; // 'passport'
126126

127127
```ts
128128
class AudienceError extends Error {
129-
readonly code: 'FLUSH_FAILED' | 'CONSENT_SYNC_FAILED' | 'NETWORK_ERROR' | 'UNKNOWN';
129+
readonly code: 'FLUSH_FAILED' | 'CONSENT_SYNC_FAILED' | 'NETWORK_ERROR' | 'VALIDATION_REJECTED';
130130
readonly status: number; // HTTP status, 0 for network failure
131131
readonly endpoint: string; // full URL that failed
132132
readonly responseBody?: unknown; // parsed JSON body from the backend

packages/audience/sdk/src/cdn.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('cdn entry point', () => {
3838

3939
// AudienceError should be constructable and extend Error
4040
const err = new (g!.AudienceError as any)({
41-
code: 'UNKNOWN',
41+
code: 'NETWORK_ERROR',
4242
message: 'test',
4343
status: 0,
4444
endpoint: 'https://example.com',

packages/audience/sdk/src/cdn.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
* for the CDN build (packages/audience/sdk/tsup.cdn.js).
1111
*/
1212

13-
import { IdentityType } from '@imtbl/audience-core';
13+
import { AudienceError, IdentityType } from '@imtbl/audience-core';
1414

1515
import { Audience } from './sdk';
1616
import { LIBRARY_VERSION } from './config';
17-
import { AudienceError } from './types';
1817

1918
type GlobalShape = {
2019
Audience: typeof Audience;

0 commit comments

Comments
 (0)