Safety check-in feature added#85
Open
MohanPrasathSece wants to merge 1 commit intoSrinjoyeeDey:mainfrom
Open
Conversation
Author
|
Kindly go through my pr and accept if its worth !! |
Owner
|
@MohanPrasathSece please resolve the current conflicts and also can you share the screenshot |
kartiks26
suggested changes
Oct 11, 2025
Comment on lines
+18
to
+19
| const user = await User.findById(item.user); | ||
| if (!user) continue; |
Contributor
There was a problem hiding this comment.
the verifyAccessToken must be looking for user right ? so it should be saved to query in previous stage itself . I think this will reduce the need of findById here.
Comment on lines
+39
to
+42
| tick(); | ||
| const timer = setInterval(tick, intervalMs); | ||
| console.log(`CheckInScheduler started: every ${intervalMs}ms (grace ${graceMs}ms)`); | ||
| return () => clearInterval(timer); |
Contributor
There was a problem hiding this comment.
setting up a cron here makes more sense than setInterval inside a api call.
Comment on lines
+5
to
+13
| const [dueAt, setDueAt] = useState<string>(""); | ||
| const [note, setNote] = useState<string>(""); | ||
| const [lat, setLat] = useState<string>(""); | ||
| const [lng, setLng] = useState<string>(""); | ||
| const [statusFilter, setStatusFilter] = useState<"" | "pending" | "confirmed" | "missed">(""); | ||
| const [loading, setLoading] = useState<boolean>(false); | ||
| const [items, setItems] = useState<CheckIn[]>([]); | ||
| const [error, setError] = useState<string>(""); | ||
| const [success, setSuccess] = useState<string>(""); |
Contributor
There was a problem hiding this comment.
There can be single state for all of this I guess.
Contributor
|
@MohanPrasathSece update pr |
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.
Safety Check-In feature is implemented across backend and frontend with a working scheduler.
Helps users schedule a time-bounded “I’m safe” confirmation.
If the user doesn’t confirm by the due time (with a small grace period), the system marks it missed and notifies their trusted contacts.