Skip to content

Conversation

@evereq
Copy link
Member

@evereq evereq commented Nov 5, 2025

PR

Please note: we will close your PR without comment if you do not check the boxes above and provide ALL requested information.


dependabot bot and others added 3 commits November 5, 2025 14:27
…-0.3.26

chore(deps): bump typeorm from 0.3.24 to 0.3.27
* fix: desktop-timer error message, offline timer

* fix: cspell Behaviour

* fix: missing startedAt while update timer status synced

* fix: adding manual timelog when timer started and stopped in offline mode and already have another starting timer

* style: remove unused code

* fix: handle another condition offline timer

* fix: remove unnecessary options

* fix: change error plain text to internationalization

* fix: rename key and added NETWOR_ERROR translation
* Merge pull request #9183 from ever-co/dependabot/npm_and_yarn/typeorm-0.3.26

chore(deps): bump typeorm from 0.3.24 to 0.3.27

* fix: desktop-timer error message, offline timer (#9180)

* fix: desktop-timer error message, offline timer

* fix: cspell Behaviour

* fix: missing startedAt while update timer status synced

* fix: adding manual timelog when timer started and stopped in offline mode and already have another starting timer

* style: remove unused code

* fix: handle another condition offline timer

* fix: remove unnecessary options

* fix: change error plain text to internationalization

* fix: rename key and added NETWOR_ERROR translation

---------

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: syns <[email protected]>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ evereq
✅ syns2191
❌ dependabot[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@evereq evereq merged commit a8f59d2 into stage-apps Nov 5, 2025
15 of 18 checks passed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch stage

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR merges changes from the develop branch into stage-apps, bringing in error handling improvements and offline timer sync enhancements for the desktop timer application.

Key Changes:

  • Introduced centralized ErrorMapping service to provide user-friendly, translated error messages for HTTP errors
  • Refactored error handling across components to use the new notification service with duplicate prevention
  • Enhanced offline timer synchronization logic to handle edge cases: timers started/stopped offline without IDs, and proper state reconciliation
  • Added three new API methods (getTimeLogById, updateTimeLog, addTimeLog) to support complex offline sync scenarios
  • Updated TypeORM from 0.3.24 to 0.3.27 across all packages
  • Added comprehensive error message translations in 13 languages

Issues Found:

  • Critical: UnauthorizedInterceptor has a broken navigation flow on line 40-44 where concatMap is called but not returned, preventing redirect to login page on 401 errors

Confidence Score: 2/5

  • This PR contains a critical bug that will break user authentication flow when sessions expire
  • Score reflects the critical logic error in UnauthorizedInterceptor that prevents proper redirect on 401 errors. The concatMap operator is created but never returned, making the navigation non-functional. This will break the authentication flow when tokens expire, leaving users unable to re-authenticate properly. The rest of the code appears sound with good improvements to error handling and offline sync.
  • Critical attention needed for packages/desktop-ui-lib/src/lib/interceptors/unauthorized.interceptor.ts - the navigation logic is broken and must be fixed before merge

Important Files Changed

File Analysis

Filename Score Overview
packages/desktop-ui-lib/src/lib/interceptors/unauthorized.interceptor.ts 1/5 Added error mapping but introduced critical bug - navigation logic not returning concatMap result, breaking unauthorized redirect
packages/desktop-ui-lib/src/lib/services/error-mapping.service.ts 5/5 New service for centralizing HTTP error message mapping with translation support
packages/desktop-ui-lib/src/lib/time-tracker/time-tracker.service.ts 4/5 Added three new methods: getTimeLogById, updateTimeLog, and addTimeLog for offline sync improvements
packages/desktop-ui-lib/src/lib/offline-sync/concretes/sequence-queue.ts 4/5 Enhanced offline timer sync logic to handle edge cases: existing time logs, stopped timers without IDs, and proper state checking

Sequence Diagram

sequenceDiagram
    participant User
    participant TimeTrackerComponent
    participant TimeTrackerService
    participant HttpInterceptor
    participant ErrorMapping
    participant ToastrNotification
    participant SequenceQueue
    participant Backend

    User->>TimeTrackerComponent: Start/Stop Timer (Offline)
    TimeTrackerComponent->>TimeTrackerService: toggleApiStart/Stop()
    TimeTrackerService->>HttpInterceptor: HTTP Request
    
    alt Network Available
        HttpInterceptor->>Backend: Forward Request
        Backend-->>HttpInterceptor: Response
        HttpInterceptor-->>TimeTrackerService: Success
        TimeTrackerService-->>TimeTrackerComponent: Timer Data
    else Network Error
        HttpInterceptor->>ErrorMapping: mapErrorMessage(error)
        ErrorMapping-->>HttpInterceptor: Translated Error Message
        HttpInterceptor-->>TimeTrackerService: Throw Error
        TimeTrackerService->>ToastrNotification: error(message)
        ToastrNotification-->>User: Display Error Toast
        TimeTrackerComponent->>SequenceQueue: Queue Offline Timer
    end

    Note over SequenceQueue: When Back Online
    SequenceQueue->>TimeTrackerService: getTimeLogById(timelogId)
    TimeTrackerService->>Backend: GET /timesheet/time-log/:id
    Backend-->>TimeTrackerService: TimeLog Data
    
    alt Timer Started Offline (No TimeLog ID)
        SequenceQueue->>TimeTrackerService: addTimeLog(payload)
        TimeTrackerService->>Backend: POST /timesheet/time-log
        Backend-->>SequenceQueue: New TimeLog
    else Timer Stopped Offline (TimeLog Exists)
        SequenceQueue->>TimeTrackerService: updateTimeLog(id, payload)
        TimeTrackerService->>Backend: PUT /timesheet/time-log/:id
        Backend-->>SequenceQueue: Updated TimeLog
    end
    
    SequenceQueue->>ToastrNotification: success("Synced")
    ToastrNotification-->>User: Display Success Toast
Loading

Additional Comments (1)

  1. packages/desktop-ui-lib/src/lib/interceptors/unauthorized.interceptor.ts, line 40-44 (link)

    logic: concatMap is called but its result is never used or returned, making the navigation non-functional

30 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants