Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Users with deadline extensions may not be able to submit feedback responses in V9 #12774

Open
jayasting98 opened this issue Feb 23, 2024 · 1 comment
Labels
c.Bug Bug/defect report committers only Difficult; better left for committers or more senior developers

Comments

@jayasting98
Copy link
Contributor

The V9 version of verifySessionOpenExceptForModeration checks if the session is open, but it may not be checking if the session is open given a deadline.

void verifySessionOpenExceptForModeration(FeedbackSession feedbackSession) throws UnauthorizedAccessException {
String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON);
if (StringHelper.isEmpty(moderatedPerson) && !(feedbackSession.isOpened() || feedbackSession.isInGracePeriod())) {
throw new UnauthorizedAccessException("The feedback session is not available for submission", true);
}
}

Note that the code is similar to the pre-V9 version, but the difference is that FeedbackSessionAttributes::isOpened checks the deadline extension, while teammates.storage.sqlentity.FeedbackSession::isOpened does not check the deadline extension.

public boolean isOpened() {
Instant now = Instant.now();
return (now.isAfter(startTime) || now.equals(startTime)) && now.isBefore(getDeadline());
}

public boolean isOpened() {
Instant now = Instant.now();
return (now.isAfter(startTime) || now.equals(startTime)) && now.isBefore(endTime);
}

(The bug was spotted in the code, not in production, so the following does not apply.)

- Environment:

Steps to reproduce

Expected behaviour

Actual behaviour

Additional info

@jayasting98 jayasting98 added c.Bug Bug/defect report committers only Difficult; better left for committers or more senior developers labels Feb 23, 2024
@jayasting98
Copy link
Contributor Author

To add, any action that relies on verifySessionOpenExceptForModeration where deadline extensions apply may also be affected, such as (Create|Update|Delete)FeedbackResponseCommentAction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Bug Bug/defect report committers only Difficult; better left for committers or more senior developers
Projects
None yet
Development

No branches or pull requests

1 participant