@oxyhq/services 20.0.0 → 20.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/ui/context/commitSessionFlow.js +10 -0
- package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/module/ui/context/commitSessionFlow.js +10 -0
- package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
- package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/ui/context/__tests__/commitSessionFlow.test.ts +27 -0
- package/src/ui/context/commitSessionFlow.ts +10 -0
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.commitDeviceSetAndResolve = commitDeviceSetAndResolve;
|
|
7
7
|
var _core = require("@oxyhq/core");
|
|
8
|
+
var _oxyContextHelpers = require("./oxyContextHelpers.js");
|
|
8
9
|
const LOG_CONTEXT = {
|
|
9
10
|
component: 'OxyContext',
|
|
10
11
|
method: 'commitSession'
|
|
@@ -48,6 +49,15 @@ async function commitDeviceSetAndResolve(deps) {
|
|
|
48
49
|
await syncFromClient();
|
|
49
50
|
};
|
|
50
51
|
const logReconcileError = registrationError => {
|
|
52
|
+
// A 401 here is the EXPECTED signed-out edge: the bearer was stale/cleared, so
|
|
53
|
+
// the device-set registration (`POST /session/device/add`) cannot carry auth.
|
|
54
|
+
// This is not a failure — the cold boot re-registers on the next load once a
|
|
55
|
+
// valid session is minted. Log at debug; warn only on genuine unexpected
|
|
56
|
+
// failures (network, 5xx, malformed).
|
|
57
|
+
if ((0, _oxyContextHelpers.isUnauthorizedStatus)(registrationError)) {
|
|
58
|
+
_core.logger.debug('commitSession: device-set registration skipped (signed out)', LOG_CONTEXT, registrationError);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
51
61
|
_core.logger.warn('commitSession: device-set registration failed', LOG_CONTEXT, registrationError);
|
|
52
62
|
};
|
|
53
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","LOG_CONTEXT","component","method","commitDeviceSetAndResolve","deps","activate","userId","fallbackUser","registerAndActivate","addCurrentAccount","startSocket","syncFromClient","getCurrentUser","loginSuccess","onAuthStateChange","markAuthResolved","reconcileDeviceSet","logReconcileError","registrationError","loggerUtil","warn","hydrateAndResolve","fullUser","profileError","__DEV__","
|
|
1
|
+
{"version":3,"names":["_core","require","_oxyContextHelpers","LOG_CONTEXT","component","method","commitDeviceSetAndResolve","deps","activate","userId","fallbackUser","registerAndActivate","addCurrentAccount","startSocket","syncFromClient","getCurrentUser","loginSuccess","onAuthStateChange","markAuthResolved","reconcileDeviceSet","logReconcileError","registrationError","isUnauthorizedStatus","loggerUtil","debug","warn","hydrateAndResolve","fullUser","profileError","__DEV__","catch"],"sourceRoot":"../../../../src","sources":["ui/context/commitSessionFlow.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,MAAME,WAAW,GAAG;EAAEC,SAAS,EAAE,YAAY;EAAEC,MAAM,EAAE;AAAgB,CAAU;AA6BjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,yBAAyBA,CAC7CC,IAAmC,EACpB;EACf,MAAM;IACJC,QAAQ;IACRC,MAAM;IACNC,YAAY;IACZC,mBAAmB;IACnBC,iBAAiB;IACjBC,WAAW;IACXC,cAAc;IACdC,cAAc;IACdC,YAAY;IACZC,iBAAiB;IACjBC;EACF,CA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CAAC,CAAC;IACzB;EACF;;EAEA;EACA;EACA;EACA,MAAMA,iBAAiB,CAAC,CAAC;EACzB,KAAKP,kBAAkB,CAAC,CAAC,CAACW,KAAK,CAACV,iBAAiB,CAAC;AACpD","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { logger as loggerUtil } from '@oxyhq/core';
|
|
4
|
+
import { isUnauthorizedStatus } from "./oxyContextHelpers.js";
|
|
4
5
|
const LOG_CONTEXT = {
|
|
5
6
|
component: 'OxyContext',
|
|
6
7
|
method: 'commitSession'
|
|
@@ -44,6 +45,15 @@ export async function commitDeviceSetAndResolve(deps) {
|
|
|
44
45
|
await syncFromClient();
|
|
45
46
|
};
|
|
46
47
|
const logReconcileError = registrationError => {
|
|
48
|
+
// A 401 here is the EXPECTED signed-out edge: the bearer was stale/cleared, so
|
|
49
|
+
// the device-set registration (`POST /session/device/add`) cannot carry auth.
|
|
50
|
+
// This is not a failure — the cold boot re-registers on the next load once a
|
|
51
|
+
// valid session is minted. Log at debug; warn only on genuine unexpected
|
|
52
|
+
// failures (network, 5xx, malformed).
|
|
53
|
+
if (isUnauthorizedStatus(registrationError)) {
|
|
54
|
+
loggerUtil.debug('commitSession: device-set registration skipped (signed out)', LOG_CONTEXT, registrationError);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
47
57
|
loggerUtil.warn('commitSession: device-set registration failed', LOG_CONTEXT, registrationError);
|
|
48
58
|
};
|
|
49
59
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["logger","loggerUtil","LOG_CONTEXT","component","method","commitDeviceSetAndResolve","deps","activate","userId","fallbackUser","registerAndActivate","addCurrentAccount","startSocket","syncFromClient","getCurrentUser","loginSuccess","onAuthStateChange","markAuthResolved","reconcileDeviceSet","logReconcileError","registrationError","warn","hydrateAndResolve","fullUser","profileError","__DEV__","
|
|
1
|
+
{"version":3,"names":["logger","loggerUtil","isUnauthorizedStatus","LOG_CONTEXT","component","method","commitDeviceSetAndResolve","deps","activate","userId","fallbackUser","registerAndActivate","addCurrentAccount","startSocket","syncFromClient","getCurrentUser","loginSuccess","onAuthStateChange","markAuthResolved","reconcileDeviceSet","logReconcileError","registrationError","debug","warn","hydrateAndResolve","fullUser","profileError","__DEV__","catch"],"sourceRoot":"../../../../src","sources":["ui/context/commitSessionFlow.ts"],"mappings":";;AACA,SAASA,MAAM,IAAIC,UAAU,QAAQ,aAAa;AAClD,SAASC,oBAAoB,QAAQ,wBAAqB;AAE1D,MAAMC,WAAW,GAAG;EAAEC,SAAS,EAAE,YAAY;EAAEC,MAAM,EAAE;AAAgB,CAAU;AA6BjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,yBAAyBA,CAC7CC,IAAmC,EACpB;EACf,MAAM;IACJC,QAAQ;IACRC,MAAM;IACNC,YAAY;IACZC,mBAAmB;IACnBC,iBAAiB;IACjBC,WAAW;IACXC,cAAc;IACdC,cAAc;IACdC,YAAY;IACZC,iBAAiB;IACjBC;EACF,CAAC,GAAGX,IAAI;;EAER;EACA;EACA;EACA;EACA,MAAMY,kBAAkB,GAAG,MAAAA,CAAA,KAA2B;IACpD,IAAIX,QAAQ,EAAE;MACZ,MAAMG,mBAAmB,CAACF,MAAM,CAAC;IACnC,CAAC,MAAM;MACL,MAAMG,iBAAiB,CAAC,CAAC;IAC3B;IACA,MAAMC,WAAW,CAAC,CAAC;IACnB,MAAMC,cAAc,CAAC,CAAC;EACxB,CAAC;EAED,MAAMM,iBAAiB,GAAIC,iBAA0B,IAAW;IAC9D;IACA;IACA;IACA;IACA;IACA,IAAInB,oBAAoB,CAACmB,iBAAiB,CAAC,EAAE;MAC3CpB,UAAU,CAACqB,KAAK,CAAC,6DAA6D,EAAEnB,WAAW,EAAEkB,iBAAiB,CAAC;MAC/G;IACF;IACApB,UAAU,CAACsB,IAAI,CAAC,+CAA+C,EAAEpB,WAAW,EAAEkB,iBAAiB,CAAC;EAClG,CAAC;;EAED;EACA;EACA;EACA,MAAMG,iBAAiB,GAAG,MAAAA,CAAA,KAA2B;IACnD,IAAIC,QAAqB,GAAG,IAAI;IAChC,IAAI;MACFA,QAAQ,GAAG,MAAMV,cAAc,CAAC,CAAC;IACnC,CAAC,CAAC,OAAOW,YAAY,EAAE;MACrB,IAAIC,OAAO,EAAE;QACX1B,UAAU,CAACqB,KAAK,CAAC,6DAA6D,EAAEnB,WAAW,EAAEuB,YAAY,CAAC;MAC5G;MACAD,QAAQ,GAAGf,YAAY;IACzB;IACA,IAAIe,QAAQ,EAAE;MACZT,YAAY,CAACS,QAAQ,CAAC;MACtBR,iBAAiB,GAAGQ,QAAQ,CAAC;IAC/B;IACAP,gBAAgB,CAAC,CAAC;EACpB,CAAC;EAED,IAAIV,QAAQ,EAAE;IACZ;IACA;IACA,IAAI;MACF,MAAMW,kBAAkB,CAAC,CAAC;IAC5B,CAAC,CAAC,OAAOE,iBAAiB,EAAE;MAC1BD,iBAAiB,CAACC,iBAAiB,CAAC;IACtC;IACA,MAAMG,iBAAiB,CAAC,CAAC;IACzB;EACF;;EAEA;EACA;EACA;EACA,MAAMA,iBAAiB,CAAC,CAAC;EACzB,KAAKL,kBAAkB,CAAC,CAAC,CAACS,KAAK,CAACR,iBAAiB,CAAC;AACpD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commitSessionFlow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/commitSessionFlow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"commitSessionFlow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/commitSessionFlow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAMxC,MAAM,WAAW,6BAA6B;IAC5C;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,mBAAmB,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,8EAA8E;IAC9E,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,sCAAsC;IACtC,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,yEAAyE;IACzE,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,6EAA6E;IAC7E,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC3C,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,IAAI,CAAC,CA+Ef"}
|
|
@@ -32,14 +32,14 @@ export declare const useUpdateProfile: () => import("@tanstack/react-query").Use
|
|
|
32
32
|
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
33
33
|
}, "strip", import("zod").ZodTypeAny, {
|
|
34
34
|
url: string;
|
|
35
|
-
description?: string | undefined;
|
|
36
35
|
id?: string | undefined;
|
|
36
|
+
description?: string | undefined;
|
|
37
37
|
title?: string | undefined;
|
|
38
38
|
image?: string | undefined;
|
|
39
39
|
}, {
|
|
40
40
|
url: string;
|
|
41
|
-
description?: string | undefined;
|
|
42
41
|
id?: string | undefined;
|
|
42
|
+
description?: string | undefined;
|
|
43
43
|
title?: string | undefined;
|
|
44
44
|
image?: string | undefined;
|
|
45
45
|
}>, "many">>;
|
|
@@ -167,6 +167,7 @@ export declare const useUpdateAccountSettings: () => {
|
|
|
167
167
|
color?: string | null;
|
|
168
168
|
name: import("@oxyhq/contracts").UserNameResponse;
|
|
169
169
|
bio?: string;
|
|
170
|
+
description?: string;
|
|
170
171
|
phone?: string;
|
|
171
172
|
address?: string;
|
|
172
173
|
birthday?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,aAAa,CAAC;AAerB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;aAqS4B,CAAC;YAEvD,CAAC;;aAEqC,CAAC;YAIxC,CAHA;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,aAAa,CAAC;AAerB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;aAqS4B,CAAC;YAEvD,CAAC;;aAEqC,CAAC;YAIxC,CAHA;;;;;;;;;;;;;;;;;;;;;UAkBI,CAAJ;mBAAyC,CAAC;aAK1C,CAAC;aAC+B,CAAC;;;UAErB,CAAC;mBACP,CAAC;aAAoC,CAAA;aACvB,CAAA;;;;;;;;;EAxOrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;SAMQ,MAAM;WAAS,MAAM;WAAS,MAAM;WAAS,MAAM;;;EA4EtF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,UAAU,8BAA8B;IACtC,yCAAyC;I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,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CACxI;AAED,4EAA4E;AAC5E,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,eAAO,MAAM,gCAAgC;;EAmD5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;EA+CpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,uFAoBjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;UAWd,gBAAgB;iBACT,SAAS,GAAG,QAAQ,GAAG,UAAU;eACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;iBACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;WAS5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commitSessionFlow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/commitSessionFlow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"commitSessionFlow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/commitSessionFlow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAMxC,MAAM,WAAW,6BAA6B;IAC5C;;;;;OAKG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,mBAAmB,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,8EAA8E;IAC9E,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,sCAAsC;IACtC,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,yEAAyE;IACzE,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,6EAA6E;IAC7E,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC3C,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,6BAA6B,GAClC,OAAO,CAAC,IAAI,CAAC,CA+Ef"}
|
|
@@ -32,14 +32,14 @@ export declare const useUpdateProfile: () => import("@tanstack/react-query").Use
|
|
|
32
32
|
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
33
33
|
}, "strip", import("zod").ZodTypeAny, {
|
|
34
34
|
url: string;
|
|
35
|
-
description?: string | undefined;
|
|
36
35
|
id?: string | undefined;
|
|
36
|
+
description?: string | undefined;
|
|
37
37
|
title?: string | undefined;
|
|
38
38
|
image?: string | undefined;
|
|
39
39
|
}, {
|
|
40
40
|
url: string;
|
|
41
|
-
description?: string | undefined;
|
|
42
41
|
id?: string | undefined;
|
|
42
|
+
description?: string | undefined;
|
|
43
43
|
title?: string | undefined;
|
|
44
44
|
image?: string | undefined;
|
|
45
45
|
}>, "many">>;
|
|
@@ -167,6 +167,7 @@ export declare const useUpdateAccountSettings: () => {
|
|
|
167
167
|
color?: string | null;
|
|
168
168
|
name: import("@oxyhq/contracts").UserNameResponse;
|
|
169
169
|
bio?: string;
|
|
170
|
+
description?: string;
|
|
170
171
|
phone?: string;
|
|
171
172
|
address?: string;
|
|
172
173
|
birthday?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,aAAa,CAAC;AAerB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;aAqS4B,CAAC;YAEvD,CAAC;;aAEqC,CAAC;YAIxC,CAHA;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useAccountMutations.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/hooks/mutations/useAccountMutations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,IAAI,EACJ,eAAe,EAChB,MAAM,aAAa,CAAC;AAerB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;aAqS4B,CAAC;YAEvD,CAAC;;aAEqC,CAAC;YAIxC,CAHA;;;;;;;;;;;;;;;;;;;;;UAkBI,CAAJ;mBAAyC,CAAC;aAK1C,CAAC;aAC+B,CAAC;;;UAErB,CAAC;mBACP,CAAC;aAAoC,CAAA;aACvB,CAAA;;;;;;;;;EAxOrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;SAMQ,MAAM;WAAS,MAAM;WAAS,MAAM;WAAS,MAAM;;;EA4EtF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,UAAU,8BAA8B;IACtC,yCAA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CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CACxI;AAED,4EAA4E;AAC5E,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,eAAO,MAAM,gCAAgC;;EAmD5C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;EA+CpC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,uFAoBjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;UAWd,gBAAgB;iBACT,SAAS,GAAG,QAAQ,GAAG,UAAU;eACnC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;iBACrB,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;WAS5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.1",
|
|
4
4
|
"description": "OxyHQ Expo/React Native SDK — UI components, screens, and native features",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
},
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@oxyhq/contracts": "0.14.0",
|
|
130
|
-
"@oxyhq/core": "^10.
|
|
130
|
+
"@oxyhq/core": "^10.1.3",
|
|
131
131
|
"color": "^4.2.3"
|
|
132
132
|
},
|
|
133
133
|
"devDependencies": {
|
|
134
134
|
"@biomejs/biome": "^1.9.4",
|
|
135
135
|
"@commitlint/cli": "^17.6.5",
|
|
136
136
|
"@commitlint/config-conventional": "^17.6.5",
|
|
137
|
-
"@oxyhq/core": "10.
|
|
137
|
+
"@oxyhq/core": "10.1.3",
|
|
138
138
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
139
139
|
"@react-native-community/netinfo": "^11.4.1",
|
|
140
140
|
"@react-native/babel-preset": "^0.86.0",
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
"peerDependencies": {
|
|
176
176
|
"@expo/vector-icons": "^15.0.3",
|
|
177
177
|
"@oxyhq/bloom": ">=0.16.0",
|
|
178
|
-
"@oxyhq/core": "^10.
|
|
178
|
+
"@oxyhq/core": "^10.1.3",
|
|
179
179
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
180
180
|
"@react-native-community/netinfo": "^11.4.1",
|
|
181
181
|
"@tanstack/query-async-storage-persister": "^5.101",
|
|
@@ -149,6 +149,33 @@ describe('commitDeviceSetAndResolve — cold boot (activate: false)', () => {
|
|
|
149
149
|
failure,
|
|
150
150
|
);
|
|
151
151
|
});
|
|
152
|
+
|
|
153
|
+
it('downgrades a 401 reconcile (signed-out edge) to debug — never warns', async () => {
|
|
154
|
+
const warnSpy = jest.spyOn(logger, 'warn').mockImplementation(() => undefined);
|
|
155
|
+
const debugSpy = jest.spyOn(logger, 'debug').mockImplementation(() => undefined);
|
|
156
|
+
const order: string[] = [];
|
|
157
|
+
// A stale/cleared bearer 401s `POST /session/device/add`: the EXPECTED
|
|
158
|
+
// signed-out outcome, not a failure the user should see warned in the console.
|
|
159
|
+
const unauthorized = Object.assign(new Error('Invalid or missing authorization header'), {
|
|
160
|
+
status: 401,
|
|
161
|
+
});
|
|
162
|
+
const deps = buildDeps(order, {
|
|
163
|
+
addCurrentAccount: jest.fn(async () => {
|
|
164
|
+
throw unauthorized;
|
|
165
|
+
}),
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
await commitDeviceSetAndResolve(deps);
|
|
169
|
+
await flush();
|
|
170
|
+
|
|
171
|
+
expect(deps.markAuthResolved).toHaveBeenCalledTimes(1);
|
|
172
|
+
expect(warnSpy).not.toHaveBeenCalled();
|
|
173
|
+
expect(debugSpy).toHaveBeenCalledWith(
|
|
174
|
+
'commitSession: device-set registration skipped (signed out)',
|
|
175
|
+
{ component: 'OxyContext', method: 'commitSession' },
|
|
176
|
+
unauthorized,
|
|
177
|
+
);
|
|
178
|
+
});
|
|
152
179
|
});
|
|
153
180
|
|
|
154
181
|
describe('commitDeviceSetAndResolve — deliberate sign-in (activate: true)', () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { User } from '@oxyhq/core';
|
|
2
2
|
import { logger as loggerUtil } from '@oxyhq/core';
|
|
3
|
+
import { isUnauthorizedStatus } from './oxyContextHelpers';
|
|
3
4
|
|
|
4
5
|
const LOG_CONTEXT = { component: 'OxyContext', method: 'commitSession' } as const;
|
|
5
6
|
|
|
@@ -72,6 +73,15 @@ export async function commitDeviceSetAndResolve(
|
|
|
72
73
|
};
|
|
73
74
|
|
|
74
75
|
const logReconcileError = (registrationError: unknown): void => {
|
|
76
|
+
// A 401 here is the EXPECTED signed-out edge: the bearer was stale/cleared, so
|
|
77
|
+
// the device-set registration (`POST /session/device/add`) cannot carry auth.
|
|
78
|
+
// This is not a failure — the cold boot re-registers on the next load once a
|
|
79
|
+
// valid session is minted. Log at debug; warn only on genuine unexpected
|
|
80
|
+
// failures (network, 5xx, malformed).
|
|
81
|
+
if (isUnauthorizedStatus(registrationError)) {
|
|
82
|
+
loggerUtil.debug('commitSession: device-set registration skipped (signed out)', LOG_CONTEXT, registrationError);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
75
85
|
loggerUtil.warn('commitSession: device-set registration failed', LOG_CONTEXT, registrationError);
|
|
76
86
|
};
|
|
77
87
|
|