Skip to content

fix: Missing error messages in Parse errors#10304

Merged
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:test/fix-flaky-tests
Mar 24, 2026
Merged

fix: Missing error messages in Parse errors#10304
mtrezza merged 1 commit intoparse-community:alphafrom
mtrezza:test/fix-flaky-tests

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Mar 24, 2026

Issue

Flaky tests obscure real failures and erode CI reliability. Two tests were listed as flaky and retried up to 5 times on each CI run:

  • ParseLiveQuery handle invalid websocket payload length — intermittent timeout
  • rest query query internal fieldTypeError: message.split is not a function

Approach

ParseLiveQuery test — The test sent an invalid WebSocket frame, then used setTimeout(1000) to save an object, racing against a random reconnection delay of 0–1000 ms. If the reconnect took close to 1000 ms, the save fired before the subscription was re-established, and the update event was permanently lost. Fixed by replacing the blind timeout with a deterministic event-driven flow: wait for the initial subscription open event, then listen for the closeopen reconnection cycle before saving.

RestQuery testParse.Error was constructed with non-string messages (raw caught error objects or undefined) in DatabaseController and RestWrite. When such an error reached Jasmine's stack trace builder, message.split('\n') crashed. Fixed by ensuring all Parse.Error constructors pass a string message. The test itself also mixed expectAsync rejection checks with success queries in Promise.all; if any rejected unexpectedly, orphaned promises caused unhandled rejections. Fixed by running the two groups sequentially.

With both root causes addressed, the tests are removed from the flaky test list.

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Mar 24, 2026

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement.

@parseplatformorg
Copy link
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.53%. Comparing base (fe9fba6) to head (0119f25).
⚠️ Report is 3 commits behind head on alpha.

Files with missing lines Patch % Lines
src/RestWrite.js 83.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10304   +/-   ##
=======================================
  Coverage   92.53%   92.53%           
=======================================
  Files         192      192           
  Lines       16502    16502           
  Branches      227      227           
=======================================
  Hits        15270    15270           
  Misses       1212     1212           
  Partials       20       20           

☔ View full report in Codecov by Sentry.
📢 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.

@mtrezza mtrezza changed the title test: Fix flaky tests fix: Missing error messages causing flaky tests Mar 24, 2026
@mtrezza mtrezza changed the title fix: Missing error messages causing flaky tests fix: Missing error messages in Parse errors Mar 24, 2026
@mtrezza mtrezza merged commit f128048 into parse-community:alpha Mar 24, 2026
23 of 24 checks passed
parseplatformorg pushed a commit that referenced this pull request Mar 24, 2026
# [9.7.0-alpha.4](9.7.0-alpha.3...9.7.0-alpha.4) (2026-03-24)

### Bug Fixes

* Missing error messages in Parse errors ([#10304](#10304)) ([f128048](f128048))
@mtrezza mtrezza deleted the test/fix-flaky-tests branch March 24, 2026 18:57
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 9.7.0-alpha.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants