fix: preserve phone identity on oauth-login completion

- Merge latest origin/dev into PR #245 for the current review baseline.\n- Sync Step 7 completion identity before oauth-login step-key handling returns.\n- Cover the real oauth-login stepKey route in the message-router regression test.
This commit is contained in:
QLHazyCoder
2026-05-15 03:10:34 +08:00
66 changed files with 6953 additions and 542 deletions
+37
View File
@@ -9,6 +9,7 @@ const api = new Function('self', `${source}; return self.MultiPageBackgroundVeri
function createVerificationFlowTestHelpers(overrides = {}) {
return api.createVerificationFlowHelpers({
addLog: async () => {},
buildVerificationPollPayload: null,
chrome: {
tabs: {
update: async () => {},
@@ -43,6 +44,42 @@ function createVerificationFlowTestHelpers(overrides = {}) {
});
}
test('verification flow prefers injected verification poll payload builder when provided', () => {
const helpers = createVerificationFlowTestHelpers({
buildVerificationPollPayload: (step, state, overrides = {}) => ({
flowId: state.activeFlowId || 'openai',
ruleId: 'custom-rule',
step,
senderFilters: ['custom-sender'],
subjectFilters: ['custom-subject'],
targetEmail: state.email,
maxAttempts: 9,
intervalMs: 4321,
...overrides,
}),
});
assert.deepStrictEqual(
helpers.getVerificationPollPayload(4, {
activeFlowId: 'openai',
email: 'user@example.com',
}, {
excludeCodes: ['111111'],
}),
{
flowId: 'openai',
ruleId: 'custom-rule',
step: 4,
senderFilters: ['custom-sender'],
subjectFilters: ['custom-subject'],
targetEmail: 'user@example.com',
maxAttempts: 9,
intervalMs: 4321,
excludeCodes: ['111111'],
}
);
});
test('verification flow keeps 2925 polling cadence in the default payload', () => {
const helpers = api.createVerificationFlowHelpers({
addLog: async () => {},