Skip to content

Commit

Permalink
Send IGNORED feedback if feedback was pending (#1116)
Browse files Browse the repository at this point in the history
* Send IGNORED feedback if feedback was pending

* Change the order of test execution

* update comment
  • Loading branch information
TamiTakamiya committed Mar 6, 2024
1 parent fa27278 commit c32184b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/features/lightspeed/inlineSuggestions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/testScripts/lightspeed/testLightspeed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -272,6 +273,10 @@ export function testLightspeed(): void {
});
});

describe("Test ignore pending suggestions", () => {
testIgnorePendingSuggestion();
});

describe("Test inline suggestion by another provider", () => {
testInlineSuggestionByAnotherProvider();
testInlineSuggestionProviderCoExistence();
Expand Down

0 comments on commit c32184b

Please sign in to comment.