diff --git a/src/features/lightspeed/inlineSuggestions.ts b/src/features/lightspeed/inlineSuggestions.ts index d032530f8..bbf3ab581 100644 --- a/src/features/lightspeed/inlineSuggestions.ts +++ b/src/features/lightspeed/inlineSuggestions.ts @@ -344,6 +344,10 @@ async function requestSuggestion( ); const suggestionId = uuidv4(); try { + // If there is a suggestion, whose feedback is pending, send a feedback with IGNORED action + // before making a new request + await ignorePendingSuggestion(); + const activityId = retrieveActivityIdFromTracker( documentInfo, inlinePosition diff --git a/test/testScripts/lightspeed/testLightspeed.test.ts b/test/testScripts/lightspeed/testLightspeed.test.ts index 25743b667..96bada0f8 100644 --- a/test/testScripts/lightspeed/testLightspeed.test.ts +++ b/test/testScripts/lightspeed/testLightspeed.test.ts @@ -17,6 +17,7 @@ import { lightSpeedManager } from "../../../src/extension"; import { testInlineSuggestionByAnotherProvider, testInlineSuggestionProviderCoExistence, + testIgnorePendingSuggestion, } from "./e2eInlineSuggestion.test"; import { UserAction } from "../../../src/definitions/lightspeed"; import { FeedbackRequestParams } from "../../../src/interfaces/lightspeed"; @@ -272,6 +273,10 @@ export function testLightspeed(): void { }); }); + describe("Test ignore pending suggestions", () => { + testIgnorePendingSuggestion(); + }); + describe("Test inline suggestion by another provider", () => { testInlineSuggestionByAnotherProvider(); testInlineSuggestionProviderCoExistence();