LCOV - code coverage report
Current view: top level - dashql-app/src/connections - result_computations.ts Coverage Total Hit
Test: DashQL 915828b Lines: 100.0 % 10 10
Test Date: 2026-11-06 19:30:32

            Line data    Source code
       1              : /// The latest analyzed result of every result owner, e.g. a session script.
       2              : ///
       3              : /// The computation of a result replaces the computation of the owner's previous result once it is
       4              : /// analyzed, the previous result stays until then. A result that is analyzed after a later result of
       5              : /// the same owner, e.g. of an overlapping rerun, is stale.
       6            1 : export class ResultComputations {
       7              :     /// The latest analyzed query of every owner
       8            1 :     private readonly latest = new Map<string, number>();
       9              : 
      10              :     /// Register the analyzed result of an owner, returns the computation that is no longer needed
      11            1 :     retain(owner: string, queryId: number): number | null {
      12            1 :         const latest = this.latest.get(owner);
      13            1 :         if (latest !== undefined && latest > queryId) {
      14            1 :             return queryId;
      15              :         }
      16            1 :         this.latest.set(owner, queryId);
      17            1 :         return latest ?? null;
      18            1 :     }
      19            1 : }
        

Generated by: LCOV version 2.0-1