Skip to content

fix: timesheet project lock timeout error#1627

Open
HarishChandran3304 wants to merge 2 commits into
version-16-hotfixfrom
fix/timesheet-project-lock
Open

fix: timesheet project lock timeout error#1627
HarishChandran3304 wants to merge 2 commits into
version-16-hotfixfrom
fix/timesheet-project-lock

Conversation

@HarishChandran3304

Copy link
Copy Markdown
Contributor

Description

  • PR to prevent project updates on timesheet save due to possible db lock contention from arbitrary background jobs causing query timeout error
  • Manual refresh project button
  • Context: Slack thread

Relevant Technical Choices

Testing Instructions

Additional Information:

Screenshot/Screencast

Screen.Recording.2026-06-24.at.7.30.38.PM.mov

Checklist

  • I have carefully reviewed the code before submitting it for review.
  • This code is adequately covered by unit tests to validate its functionality.
  • I have conducted thorough testing to ensure it functions as intended.
  • A member of the QA team has reviewed and tested this PR (To be checked by QA or code reviewer)

Fixes #

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 aims to reduce Timesheet-save failures caused by DB lock contention (notably on Project) by avoiding automatic Project updates during Timesheet updates, and instead providing a manual Project costing refresh action in the UI.

Changes:

  • Override Timesheet’s update_task_and_project() to update Tasks but skip the Project update loop (reducing Project-table write contention during Timesheet saves).
  • Add a Refresh Costing custom button on the Project form that triggers a dedicated costing refresh call.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
next_pms/public/js/project.js Adds a Project form button to manually refresh costing/billing fields.
next_pms/project_currency/overrides/timesheet.py Overrides Timesheet’s task/project update flow to avoid Project updates during Timesheet saves.

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

Comment thread next_pms/project_currency/overrides/timesheet.py
@robinroy03

Copy link
Copy Markdown
Member

@HarishChandran3304 could you confirm if the bug is still present? If so change the branch to feat/redesign since it is the upstream.

@HarishChandran3304

Copy link
Copy Markdown
Contributor Author

@HarishChandran3304 could you confirm if the bug is still present? If so change the branch to feat/redesign since it is the upstream.

@robinroy03 The issue isnt very reproducible, it was happening arbitrarily. We can wait a bit to see if anyone reports this else we can close it.

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