Skip to content

Comments

Safety check-in feature added#85

Open
MohanPrasathSece wants to merge 1 commit intoSrinjoyeeDey:mainfrom
MohanPrasathSece:x
Open

Safety check-in feature added#85
MohanPrasathSece wants to merge 1 commit intoSrinjoyeeDey:mainfrom
MohanPrasathSece:x

Conversation

@MohanPrasathSece
Copy link

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.

@MohanPrasathSece
Copy link
Author

Kindly go through my pr and accept if its worth !!

@SrinjoyeeDey
Copy link
Owner

@MohanPrasathSece please resolve the current conflicts and also can you share the screenshot

Comment on lines +18 to +19
const user = await User.findById(item.user);
if (!user) continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

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>("");
Copy link
Contributor

Choose a reason for hiding this comment

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

There can be single state for all of this I guess.

@kartiks26
Copy link
Contributor

@MohanPrasathSece update pr

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.

3 participants