Skip to content

Commit

Permalink
fix JSONL getEventIdxByTimestamp + timestamp hash param not cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry8192 committed Dec 11, 2024
1 parent 54ef03c commit 6c2b45a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/contexts/UrlContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ const getWindowUrlHashParams = () => {
const hashParam = hashParams.get(hashParamName);
if (null !== hashParam) {
const parsed = Number(hashParam);
urlHashParams[HASH_PARAM_NAMES.LOG_EVENT_NUM] = Number.isNaN(parsed) ?

// FIXME: hashParamName type

Check failure on line 213 in src/contexts/UrlContextProvider.tsx

View workflow job for this annotation

GitHub Actions / lint-check

Unexpected 'fixme' comment: 'FIXME: hashParamName type'
urlHashParams[hashParamName] = Number.isNaN(parsed) ?
null :
parsed;
}
Expand Down
4 changes: 3 additions & 1 deletion src/services/decoders/JsonlDecoder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ class JsonlDecoder implements Decoder {
const mid = Math.floor((low + high) / 2);
const midTimestamp = BigInt(this.#logEvents[mid].timestamp.valueOf());

if (midTimestamp === timestamp) {
console.log(`midTimestamp: ${midTimestamp}, mid: ${mid}, low: ${low}, high: ${high}`);
if (midTimestamp == timestamp) {

Check failure on line 135 in src/services/decoders/JsonlDecoder/index.ts

View workflow job for this annotation

GitHub Actions / lint-check

Expected '===' and instead saw '=='
console.error(`result recorded: ${mid}`);
result = mid;
low = mid + 1;
} else if (midTimestamp < timestamp) {
Expand Down
2 changes: 1 addition & 1 deletion src/typings/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ enum CURSOR_CODE {
type CursorArgMap = {
[CURSOR_CODE.LAST_EVENT]: null;
[CURSOR_CODE.EVENT_NUM]: { eventNum: number };
[CURSOR_CODE.TIMESTAMP]: { timestamp: number };
[CURSOR_CODE.TIMESTAMP]: { timestamp: bigint };
[CURSOR_CODE.PAGE_NUM]: { pageNum: number, eventPositionOnPage: EVENT_POSITION_ON_PAGE };
};

Expand Down

0 comments on commit 6c2b45a

Please sign in to comment.