Skip to content

Comments

feat: Extend problem statement editing deadline to end of Jan 1st#19

Merged
ManasMalla merged 1 commit intomainfrom
feature/referral-code-team-registration
Jan 1, 2026
Merged

feat: Extend problem statement editing deadline to end of Jan 1st#19
ManasMalla merged 1 commit intomainfrom
feature/referral-code-team-registration

Conversation

@CherukuriPavanKumar
Copy link
Collaborator

  • Changed deadline from Jan 1st 00:00:00 to Jan 2nd 00:00:00
  • Users can now edit problem statements throughout entire day of Jan 1st
  • Editing will close at midnight when Jan 2nd starts

- Changed deadline from Jan 1st 00:00:00 to Jan 2nd 00:00:00
- Users can now edit problem statements throughout entire day of Jan 1st
- Editing will close at midnight when Jan 2nd starts
Copilot AI review requested due to automatic review settings January 1, 2026 11:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the problem statement editing deadline to allow users to edit throughout the entire day of January 1st, 2026, by changing the cutoff from midnight at the start of Jan 1st to midnight at the start of Jan 2nd.

  • Updated the isEditingAllowed date check from 2026-01-01T00:00:00 to 2026-01-02T00:00:00
  • Updated the inline comment to clarify that editing is allowed "until end of Jan 1st, 2026"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +38 to +39
// Check if editing is allowed (until end of Jan 1st, 2026)
const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00');
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

This is only a client-side check with no server-side validation. Users can bypass this deadline restriction by modifying the client code, manipulating their system time, or directly calling the Firebase updateDoc function. The handleSaveProblemStatement function (lines 130-149) performs no server-side deadline validation.

Consider adding server-side validation in Firestore security rules to enforce this deadline reliably. For example, in firestore.rules, you could add a condition that checks request.time against the deadline for updates to the problemStatement field.

Suggested change
// Check if editing is allowed (until end of Jan 1st, 2026)
const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00');
// Editing eligibility is enforced in Firestore security rules.
// This flag is only used to control the UI and MUST NOT be treated as an access-control mechanism.
const isEditingAllowed = true;

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +39
// Check if editing is allowed (until end of Jan 1st, 2026)
const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00');
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

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

The date string lacks a timezone specifier, so it will be interpreted in the user's local timezone rather than a consistent timezone like UTC. This means the deadline will occur at different real-world times for users in different timezones. For example, a user in EST will have the deadline at midnight EST (05:00 UTC on Jan 2), while a user in PST will have it at midnight PST (08:00 UTC on Jan 2).

Consider specifying a timezone explicitly to ensure consistent behavior for all users. For example, use 'Z' for UTC or specify a specific timezone offset like '-05:00' for EST.

Suggested change
// Check if editing is allowed (until end of Jan 1st, 2026)
const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00');
// Check if editing is allowed (until end of Jan 1st, 2026, in UTC)
const isEditingAllowed = new Date() < new Date('2026-01-02T00:00:00Z');

Copilot uses AI. Check for mistakes.
@ManasMalla ManasMalla merged commit bfc1369 into main Jan 1, 2026
6 of 7 checks passed
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.

2 participants