diff --git a/frontend/src/app/workspace/service/workflow-result/workflow-result.service.spec.ts b/frontend/src/app/workspace/service/workflow-result/workflow-result.service.spec.ts index 6bf168ed62f..e8575d6436a 100644 --- a/frontend/src/app/workspace/service/workflow-result/workflow-result.service.spec.ts +++ b/frontend/src/app/workspace/service/workflow-result/workflow-result.service.spec.ts @@ -19,6 +19,7 @@ import { TestBed } from "@angular/core/testing"; import { + ALL_COLUMNS, OperatorPaginationResultService, OperatorResultService, WorkflowResultService, @@ -474,6 +475,15 @@ describe("OperatorPaginationResultService", () => { expect((service as any).pendingRequests.size).toBe(0); }); + it("asks for every column within the server's Int when no column limit is given", () => { + service.selectPage(3, 10).subscribe(); + + expect(mockWorkflowWebsocketService.send).toHaveBeenCalledWith( + "ResultPaginationRequest", + expect.objectContaining({ columnLimit: ALL_COLUMNS }) + ); + }); + it("bypasses the frontend cache when column filters are set", () => { (service as any).resultCache.set(2, [{ id: 1 }]); service.selectPage(2, 10, 5).subscribe(); diff --git a/frontend/src/app/workspace/service/workflow-result/workflow-result.service.ts b/frontend/src/app/workspace/service/workflow-result/workflow-result.service.ts index 2b73e418372..7c120579024 100644 --- a/frontend/src/app/workspace/service/workflow-result/workflow-result.service.ts +++ b/frontend/src/app/workspace/service/workflow-result/workflow-result.service.ts @@ -262,6 +262,12 @@ export class OperatorResultService { } } +/** + * A column limit that asks for every column. The server reads the limit as a 32-bit Int, so it is + * Int.MaxValue there; Number.MAX_SAFE_INTEGER fails to parse and the request is never answered. + */ +export const ALL_COLUMNS = 2147483647; + export class OperatorPaginationResultService { private pendingRequests: Map> = new Map(); private resultCache: Map> = new Map(); @@ -317,14 +323,13 @@ export class OperatorPaginationResultService { pageIndex: number, pageSize: number, columnOffset: number = 0, - columnLimit: number = Number.MAX_SAFE_INTEGER, + columnLimit: number = ALL_COLUMNS, columnSearch: string = "" ): Observable { // update currently selected page this.currentPageIndex = pageIndex; // first fetch from frontend result cache - const useCache = - this.portIndex === 0 && columnOffset === 0 && columnLimit === Number.MAX_SAFE_INTEGER && columnSearch === ""; + const useCache = this.portIndex === 0 && columnOffset === 0 && columnLimit === ALL_COLUMNS && columnSearch === ""; const pageCache = useCache ? this.resultCache.get(pageIndex) : undefined; if (pageCache) { return of({