Skip to content

feat: Add support for an identify queue. #842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jun 10, 2025
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8b24438
chore: Add implementation for async task queue.
kinyoklion Apr 30, 2025
7f5fd64
Lint
kinyoklion Apr 30, 2025
6891c52
More tests.
kinyoklion Apr 30, 2025
fcf0990
Clarify comment.
kinyoklion Apr 30, 2025
178973b
WIP
kinyoklion Apr 30, 2025
efec1ef
Lint and test.
kinyoklion May 1, 2025
d311964
Add identifyResult method.
kinyoklion May 1, 2025
75a9cea
Merge branch 'main' into rlamb/emsr-86/implement-client-side-identify
kinyoklion May 1, 2025
b6fac89
Revert unneeded change from test file.
kinyoklion May 1, 2025
e9c62f7
Remove browser client facade.
kinyoklion May 1, 2025
f0d08b6
Add implementation comment.
kinyoklion May 1, 2025
d5331e8
Sheddable.
kinyoklion May 2, 2025
9c48c5b
Log as well as throw.
kinyoklion May 2, 2025
c0dbad1
Check size impact of a factory instead of a class.
kinyoklion May 2, 2025
4f22426
Lint
kinyoklion May 2, 2025
3955464
Update size limit and report.
kinyoklion May 2, 2025
98f7746
WIP
kinyoklion May 7, 2025
c49d936
Linting
kinyoklion May 13, 2025
286b0ee
Merge branch 'main' into rlamb/emsr-86/implement-client-side-identify
kinyoklion May 21, 2025
3d8157f
Support before/after identify with identify queue.
kinyoklion May 21, 2025
27bbb0a
Merge branch 'main' into rlamb/emsr-86/implement-client-side-identify
kinyoklion May 21, 2025
6db624d
Add another test.
kinyoklion May 21, 2025
958ec8f
Lint
kinyoklion May 21, 2025
6d436ae
Update packages/shared/sdk-client/src/api/LDIdentifyOptions.ts
kinyoklion Jun 9, 2025
157e366
Change context parameter name.
kinyoklion Jun 9, 2025
2ff703d
Merge branch 'main' into rlamb/emsr-86/implement-client-side-identify
kinyoklion Jun 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More tests.
  • Loading branch information
kinyoklion committed Apr 30, 2025
commit 6891c52752ebe1bf46e126e9a53441615474658b
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,46 @@ it('handles mix of shedable and non-shedable tasks correctly', async () => {
expect(task3).not.toHaveBeenCalled();
expect(task4).toHaveBeenCalled();
});

it('executes tasks in order regardless of time to complete', async () => {
const queue = new AsyncTaskQueue<string>();
const timedPromise = (ms: number) =>
new Promise((resolve) => {
setTimeout(resolve, ms);
});
const callOrder: string[] = [];
const task1 = jest.fn().mockImplementation(() => {
callOrder.push('task1Start');
return timedPromise(10).then(() => {
callOrder.push('task1End');
return 'test1';
});
});
const task2 = jest.fn().mockImplementation(() => {
callOrder.push('task2Start');
return timedPromise(5).then(() => {
callOrder.push('task2End');
return 'test2';
});
});
const task3 = jest.fn().mockImplementation(() => {
callOrder.push('task3Start');
return timedPromise(20).then(() => {
callOrder.push('task3End');
return 'test3';
});
});
const promise1 = queue.execute(task1, false);
const promise2 = queue.execute(task2, false);
const promise3 = queue.execute(task3, false);

await Promise.all([promise1, promise2, promise3]);
expect(callOrder).toEqual([
'task1Start',
'task1End',
'task2Start',
'task2End',
'task3Start',
'task3End',
]);
});