Exp/pre invinsible#29
Open
rishal-ERPGULF wants to merge 5 commits into
Open
Conversation
- 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]>
Co-authored-by: Copilot <[email protected]>
61010db to
df18ceb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
checkinStartTime) and check-out (lastCheckoutTime) times usingAsyncStorage, and ensured these are updated and cleared appropriately on check-in/out actions in bothuseAttendanceCheckInOutandAttendanceCamera. [1] [2] [3] [4] [5]useAttendanceMetaby 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]getAttendanceStatusto consistently extract and normalize check-in status and time, supporting multiple possible field names and value types.Redux state and logic fixes:
checkinTimetonull), and that check-in time is always set from the validated timestamp source. [1] [2]Testing enhancements:
Other:
These changes greatly improve the reliability of attendance tracking, especially in real-world scenarios involving app restarts, network issues, or delayed backend updates.