Skip to content

fix: Profiler: use $title as key in start() so it will correctly be unset in stop()#14019

Merged
Nicolas Fortier (nfortier-shopware) merged 6 commits intoshopware:trunkfrom
daniel-memo-ict:bugfix/profiler-start-stop
Jan 29, 2026
Merged

fix: Profiler: use $title as key in start() so it will correctly be unset in stop()#14019
Nicolas Fortier (nfortier-shopware) merged 6 commits intoshopware:trunkfrom
daniel-memo-ict:bugfix/profiler-start-stop

Conversation

@daniel-memo-ict
Copy link
Copy Markdown
Contributor

@daniel-memo-ict Daniel Schipper (daniel-memo-ict) commented Dec 15, 2025

1. Why is this change necessary?

When using Profiler::start() and Profiler::stop() separately a LogicException will be thrown during Profiler::cleanup() as it thinks it still has an open trace. This happens because Profiler::start() stores the title as a value in $openTraces but Profiler::stop() tries to use the title as a key.

2. What does this change do, exactly?

Prevents a LogicException from occuring during shutdown when using Profiler start/stop separately

3. Describe each step to reproduce the issue or behaviour.

  1. Setup Stopwatch and/or Symfony profiler
  2. Use Profiler::start('test');
  3. Use Profiler::stop('test');
  4. Get LogicException with message "'test' has not been started"

4. Please link to the relevant issues (if any).

5. Checklist

  • I have written tests and verified that they fail without my change
  • I have updated developer-facing release notes if this change is relevant for external developers:
    • Add a short entry to RELEASE_INFO-6.<major>.md under “Upcoming” for informational changes, including the consequences of the change and how it affects external developers.
    • Add an UPGRADE section in UPGRADE-6.<next-major>.md for breaking changes (what/why/impact/how to adapt).
    • See the Documenting a Release Process for details.
  • I have written or adjusted the documentation according to my changes
  • This change has comments for package types, values, functions, and non-obvious lines of code
  • I have read the contribution requirements and fulfilled them

@github-actions github-actions bot added external-contribution A PR contributed by a community member. milestone/6.7.6.0 labels Dec 15, 2025
@github-actions
Copy link
Copy Markdown

Warnings
⚠️ The Pull Request doesn't contain any release info, if your changes are relevant for external developers please add an entry to the release info file, including the consequences of the change and how it affects external developers. For detailed infos please refer to the [release documentation guide](https://github.com/shopware/shopware/blob/trunk/delivery-process/documenting-a-release.md).

@explore-openapi
Copy link
Copy Markdown

explore-openapi bot commented Dec 15, 2025

OpenAPI Snapshot

Project: shopware/store-api

No changes detected

Your OpenAPI schema is identical to the base branch (trunk).

Links:
All Project Snapshots · Base Branch Snapshot

Project: shopware/admin-api

No changes detected

Your OpenAPI schema is identical to the base branch (trunk).

Links:
All Project Snapshots · Base Branch Snapshot

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.38%. Comparing base (8be9b6b) to head (2d63c76).
⚠️ Report is 1 commits behind head on trunk.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #14019      +/-   ##
==========================================
+ Coverage   55.35%   55.38%   +0.03%     
==========================================
  Files        2962     2962              
  Lines       91428    91424       -4     
==========================================
+ Hits        50609    50638      +29     
+ Misses      40819    40786      -33     
Flag Coverage Δ
phpunit-migration 92.23% <ø> (ø)
phpunit-unit 52.88% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added the needs-triage A newly created issue or PR that needs team assignment and/or prioritization. label Dec 15, 2025
@BrocksiNet Björn Meyer (BrocksiNet) added domain/framework Responsible for the framework-level code includes core, administration, storefront, and frontends and removed needs-triage A newly created issue or PR that needs team assignment and/or prioritization. labels Dec 15, 2025
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 15, 2025

CLA assistant check
All committers have signed the CLA.

@nfortier-shopware
Copy link
Copy Markdown
Contributor

Hey Daniel Schipper (@daniel-memo-ict) thanks for improving this! Let me know if you need help to finalise this

@nfortier-shopware
Copy link
Copy Markdown
Contributor

Hey Daniel Schipper (@daniel-memo-ict), any news on this?

@nfortier-shopware
Copy link
Copy Markdown
Contributor

Hi Daniel Schipper (@daniel-memo-ict) any update?

@daniel-memo-ict
Copy link
Copy Markdown
Contributor Author

Sorry, we're in the middle of a big project updating a client from 6.4 to 6.7, I haven't had time to update this PR yet.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 29, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 29, 2026
Merged via the queue into shopware:trunk with commit eddae40 Jan 29, 2026
93 of 95 checks passed
@github-actions github-actions bot added this to the 6.7.8.0 milestone Jan 29, 2026
shopware-octo-sts-app bot pushed a commit that referenced this pull request Jan 29, 2026
…nset in stop() (#14019)

Co-authored-by: Nicolas Fortier <[email protected]>
Co-authored-by: Nicolas Fortier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-6.6.x component/core domain/framework Responsible for the framework-level code includes core, administration, storefront, and frontends external-contribution A PR contributed by a community member. milestone/6.7.8.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants