label-studio icon indicating copy to clipboard operation
label-studio copied to clipboard

fix: Update middleware.py to remove excess calls to Organization objects

Open tsr10 opened this issue 1 year ago β€’ 6 comments

…irst()

Organization.first() was being called too many times. This tries to find it on the user object. See attached screenshot for an example of the extra load this was causing.

image

PR fulfills these requirements

  • [ ] Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • [ ] Tests for the changes have been added/updated (for bug fixes/features)
  • [ ] Docs have been added/updated (for bug fixes/features)
  • [ ] Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • [ ] Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

(check all that apply)

  • [ ] Product design
  • [ ] Backend (Database)
  • [ ] Backend (API)
  • [ ] Frontend

Describe the reason for change

(link to issue, supportive screenshots etc.)

What does this fix?

(if this is a bug fix)

What is the new behavior?

(if this is a breaking or feature change)

What is the current behavior?

(if this is a breaking or feature change)

What libraries were added/updated?

(list all with version changes)

Does this change affect performance?

(if so describe the impacts positive or negative)

Does this change affect security?

(if so describe the impacts positive or negative)

What alternative approaches were there?

(briefly list any if applicable)

What feature flags were used to cover this change?

(briefly list any if applicable)

Does this PR introduce a breaking change?

(check only one)

  • [ ] Yes, and covered entirely by feature flag(s)
  • [ ] Yes, and covered partially by feature flag(s)
  • [ ] No
  • [ ] Not sure (briefly explain the situation below)

What level of testing was included in the change?

(check all that apply)

  • [ ] e2e
  • [ ] integration
  • [ ] unit

Which logical domain(s) does this change affect?

(for bug fixes/features, be as precise as possible. ex. Authentication, Annotation History, Review Stream etc.)

tsr10 avatar Feb 27 '24 17:02 tsr10

Deploy request for label-studio-docs-new-theme pending review.

Visit the deploys page to approve it

Name Link
Latest commit cae6b136231f875c5c77a4f570478b8435b72ed4

netlify[bot] avatar Feb 27 '24 17:02 netlify[bot]

Deploy request for heartex-docs pending review.

Visit the deploys page to approve it

Name Link
Latest commit cae6b136231f875c5c77a4f570478b8435b72ed4

netlify[bot] avatar Feb 27 '24 17:02 netlify[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.89%. Comparing base (9a03cb5) to head (cae6b13). Report is 1365 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #5514   +/-   ##
========================================
  Coverage    75.89%   75.89%           
========================================
  Files          156      156           
  Lines        13020    13023    +3     
========================================
+ Hits          9881     9884    +3     
  Misses        3139     3139           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Mar 10 '24 01:03 codecov[bot]

/jira create

Workflow run Jira issue TRIAG-598 is created

sajarin avatar Jun 05 '24 17:06 sajarin

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

robot-ci-heartex avatar Jul 21 '24 01:07 robot-ci-heartex

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

robot-ci-heartex avatar Oct 19 '24 01:10 robot-ci-heartex

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

robot-ci-heartex avatar Dec 04 '24 02:12 robot-ci-heartex

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

robot-ci-heartex avatar Jan 20 '25 01:01 robot-ci-heartex

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

robot-ci-heartex avatar Mar 10 '25 01:03 robot-ci-heartex

This PR was closed because it has been stalled for 10 days with no activity.

robot-ci-heartex avatar Mar 20 '25 02:03 robot-ci-heartex