Skip to content

Exp/pre invinsible#29

Open
rishal-ERPGULF wants to merge 5 commits into
mainfrom
exp/pre-invinsible
Open

Exp/pre invinsible#29
rishal-ERPGULF wants to merge 5 commits into
mainfrom
exp/pre-invinsible

Conversation

@rishal-ERPGULF
Copy link
Copy Markdown
Contributor

This pull request introduces significant improvements to the reliability and consistency of attendance check-in/out time handling across the app. The main focus is on robustly storing, syncing, and validating check-in and check-out timestamps, especially in edge cases such as app restarts, backend data staleness, or conflicting local and remote states. It also adds comprehensive tests and utility functions to ensure correct behavior.

Attendance timestamp storage and sync improvements:

  • Introduced persistent storage for check-in (checkinStartTime) and check-out (lastCheckoutTime) times using AsyncStorage, and ensured these are updated and cleared appropriately on check-in/out actions in both useAttendanceCheckInOut and AttendanceCamera. [1] [2] [3] [4] [5]
  • Enhanced the logic for syncing check-in time from backend status in useAttendanceMeta by normalizing, validating, and comparing multiple timestamp sources (backend, local storage, Redux state), and always picking the most plausible and recent value. Added utility functions for timestamp parsing and selection. [1] [2] [3]
  • Improved backend response parsing in getAttendanceStatus to consistently extract and normalize check-in status and time, supporting multiple possible field names and value types.

Redux state and logic fixes:

  • Ensured Redux state is cleared correctly on checkout (resetting checkinTime to null), and that check-in time is always set from the validated timestamp source. [1] [2]

Testing enhancements:

  • Added comprehensive tests to cover scenarios such as focus refresh, backend timestamp staleness, and local/remote check-in time conflicts, ensuring the correct check-in time is always used. [1] [2] [3]

Other:

  • Updated the version string in the Profile screen for release tracking.

These changes greatly improve the reliability of attendance tracking, especially in real-world scenarios involving app restarts, network issues, or delayed backend updates.

rishal-ERPGULF and others added 5 commits April 29, 2026 12:23
- Implement AttendanceActionForm for displaying date, location, and check-in/out actions.
- Create BreakInProgressBanner to show ongoing break status and time.
- Develop DevBreakTools for testing break scenarios with presets.
- Add helper functions for break management in helpers.js.
- Implement useAttendanceBreakFlow hook to manage break logic and state.
- Create useAttendanceCheckInOut hook for handling check-in/out actions.
- Add useAttendanceDevActions for development-related actions like invalidating tokens.
- Implement useAttendanceMeta for managing attendance metadata and location checks.
- Create useAttendanceActionController to consolidate attendance-related hooks and state management.

Co-authored-by: Copilot <[email protected]>
@rishal-ERPGULF rishal-ERPGULF force-pushed the main branch 2 times, most recently from 61010db to df18ceb Compare April 29, 2026 13:19
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.

1 participant