Skip to content

ref(feedback) set submission timeout to 30 seconds #16918

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
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions packages/feedback/src/core/sendFeedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export const sendFeedback: SendFeedback = (

// We want to wait for the feedback to be sent (or not)
return new Promise<string>((resolve, reject) => {
// After 5s, we want to clear anyhow
const timeout = setTimeout(() => reject('Unable to determine if Feedback was correctly sent.'), 5_000);
// After 30s, we want to clear anyhow
const timeout = setTimeout(() => reject('Unable to determine if Feedback was correctly sent.'), 30_000);

const cleanup = client.on('afterSendEvent', (event: Event, response: TransportMakeRequestResponse) => {
if (event.event_id !== eventId) {
Expand Down
4 changes: 2 additions & 2 deletions packages/feedback/test/core/sendFeedback.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ describe('sendFeedback', () => {

mockSdk();
vi.spyOn(getClient()!.getTransport()!, 'send').mockImplementation(() => {
return new Promise(resolve => setTimeout(resolve, 10_000));
return new Promise(resolve => setTimeout(resolve, 40_000));
});

const promise = sendFeedback({
Expand All @@ -330,7 +330,7 @@ describe('sendFeedback', () => {
message: 'mi',
});

vi.advanceTimersByTime(5_000);
vi.advanceTimersByTime(30_000);

await expect(promise).rejects.toMatch('Unable to determine if Feedback was correctly sent.');

Expand Down
Loading