Skip to content

(fix): reset route to avoid clobbering otel#11885

Merged
abnegate merged 2 commits into1.9.xfrom
fix-gql-route-reset
Apr 14, 2026
Merged

(fix): reset route to avoid clobbering otel#11885
abnegate merged 2 commits into1.9.xfrom
fix-gql-route-reset

Conversation

@abnegate
Copy link
Copy Markdown
Member

What does this PR do?

(Provide a description of what this PR does and why it's needed.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 13, 2026

Greptile Summary

Stores the active Http route before the internal match() call and restores it in a finally block, preventing the GraphQL sub-resolver route from clobbering the parent route that OpenTelemetry (and other instrumentation) reads after request execution. The fix is scoped entirely to Resolvers::resolve() and the try/catch/finally pattern is correct.

Confidence Score: 5/5

Safe to merge; the fix is minimal and correct, with only a minor P2 observation about the null-original edge case.

Single-file, targeted fix. The try/finally pattern correctly covers both the happy path and exception path. The only open question (null-route guard) is a minor style concern that does not affect the primary bug being fixed.

No files require special attention.

Important Files Changed

Filename Overview
src/Appwrite/GraphQL/Resolvers.php Adds route save/restore in a finally block inside resolve() so that OpenTelemetry's view of the active route is not clobbered by the internal match() call made for each GraphQL sub-resolver.

Reviews (1): Last reviewed commit: "(chore): rename" | Re-trigger Greptile

Comment thread src/Appwrite/GraphQL/Resolvers.php
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

🔄 PHP-Retry Summary

Flaky tests detected across commits:

Commit cc8eb62 - 9 flaky tests
Test Retries Total Time Details
UsageTest::testFunctionsStats 1 10.24s Logs
UsageTest::testPrepareSitesStats 1 7ms Logs
UsageTest::testEmbeddingsTextUsageDoesNotBreakProjectUsage 1 5ms Logs
LegacyConsoleClientTest::testListDocumentsWithCache 1 274ms Logs
LegacyConsoleClientTest::testListDocumentsCacheBustedByAttributeChange 1 1.14s Logs
LegacyConsoleClientTest::testListDocumentsCachePurgedByUpdate 1 715ms Logs
LegacyCustomClientTest::testCreateIndexes 1 246.06s Logs
LegacyCustomServerTest::testCreateIndexes 1 241.06s Logs
LegacyTransactionsCustomClientTest::testIncrementDecrementEndpointsWithTransaction 1 240.56s Logs

@github-actions
Copy link
Copy Markdown

✨ Benchmark results

  • Requests per second: 1,842
  • Requests with 200 status code: 331,631
  • P99 latency: 0.098071563

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,842 1,428
200 331,631 257,165
P99 0.098071563 0.141883853

@abnegate abnegate merged commit 6c8b34c into 1.9.x Apr 14, 2026
80 of 82 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.

1 participant