Skip to content

fix: Build platform correct path when serving files. - #207

Merged
SandPod merged 1 commit into
mainfrom
build-platform-dependent-path
Oct 10, 2025
Merged

SandPod merged 1 commit into
mainfrom
build-platform-dependent-path

Conversation

@SandPod

@SandPod SandPod commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Fixes a minor issue where we would not build valid paths for the windows platform when serving files.

Before this fix, given a static root directory located at C:\\my\static\root\ and a request path for a file located at assets/image.png the following path would be constructed C:\\my\static\root\assets/image.png (Note the mix of forward and backward slashes).

Windows handles this gracefully, so can't catch this in the tests, but it was incorrect behavior.

If you have a suggestion on how to capture this in the tests I would appreciate it.

Pre-Launch Checklist

Please ensure that your PR meets the following requirements before submitting:

  • This update focuses on a single feature or bug fix. (For multiple fixes, please submit separate PRs.)
  • I have read and followed the Dart Style Guide and formatted the code using dart format.
  • I have referenced at least one issue this PR fixes or is related to.
  • I have updated/added relevant documentation (doc comments with ///), ensuring consistency with existing project documentation.
  • I have added new tests to verify the changes.
  • All existing and new tests pass successfully.
  • I have documented any breaking changes below.

Breaking Changes

  • Includes breaking changes.
  • No breaking changes.

Simple path fix.

@SandPod
SandPod requested a review from a team October 10, 2025 08:08
@coderabbitai

coderabbitai Bot commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch build-platform-dependent-path

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Oct 10, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.90%. Comparing base (3dbfe36) to head (1a848c2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #207      +/-   ##
==========================================
+ Coverage   91.85%   91.90%   +0.04%     
==========================================
  Files          85       85              
  Lines        3156     3174      +18     
  Branches     1631     1639       +8     
==========================================
+ Hits         2899     2917      +18     
  Misses        257      257              

☔ 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.

@nielsenko nielsenko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@SandPod

SandPod commented Oct 10, 2025

Copy link
Copy Markdown
Contributor Author

@coderabbitai - The first testrun for macos latest failed in a websocket test. Please file an issue to track this flaky test.

@SandPod
SandPod merged commit 922a5a7 into main Oct 10, 2025
@SandPod
SandPod deleted the build-platform-dependent-path branch October 10, 2025 08:22
@coderabbitai

coderabbitai Bot commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Get the workflow runs for this PR
echo "=== Workflow runs for PR #207 ==="
gh pr view 207 --repo serverpod/relic --json statusCheckRollup --jq '.statusCheckRollup[] | select(.conclusion == "failure" or .conclusion == "FAILURE") | {name: .name, conclusion: .conclusion, detailsUrl: .detailsUrl}'

# Get more details about recent workflow runs
echo -e "\n=== Recent workflow runs ==="
gh run list --repo serverpod/relic --limit 10 --json name,conclusion,databaseId,createdAt,event,headBranch,displayTitle

# Try to get the maintainer/owner info
echo -e "\n=== Repository owner/maintainer ==="
gh repo view serverpod/relic --json owner --jq '.owner.login'

# Get PR details
echo -e "\n=== PR details ==="
gh pr view 207 --repo serverpod/relic --json author,headRefName,number,url

Length of output: 2796


🏁 Script executed:

#!/bin/bash

# Get the specific workflow run ID for PR 207's "Relic Ci" workflow
echo "=== Getting workflow run details for PR #207 ==="
gh run list --repo serverpod/relic --branch build-platform-dependent-path --json databaseId,name,conclusion,createdAt,event,url --limit 5

# Try to get the logs from the most recent Relic Ci run for this branch
echo -e "\n=== Getting run ID ==="
RUN_ID=$(gh run list --repo serverpod/relic --branch build-platform-dependent-path --workflow "Relic Ci" --json databaseId --limit 1 --jq '.[0].databaseId')
echo "Run ID: $RUN_ID"

# Get the jobs for this run
echo -e "\n=== Jobs for the workflow run ==="
gh run view $RUN_ID --repo serverpod/relic --json jobs --jq '.jobs[] | {name: .name, conclusion: .conclusion, steps: [.steps[] | select(.conclusion == "failure") | {name: .name, conclusion: .conclusion}]}'

# Try to get logs (this might be large, so let's filter)
echo -e "\n=== Checking for test failures in logs ==="
gh run view $RUN_ID --repo serverpod/relic --log | grep -i -A 5 -B 5 "websocket\|failed\|error" | head -100

Length of output: 22546


🏁 Script executed:

#!/bin/bash

# Search for any failed runs on this branch or any websocket-related failures
echo "=== Searching for all workflow runs on this branch including failures ==="
gh run list --repo serverpod/relic --branch build-platform-dependent-path --json databaseId,name,conclusion,createdAt,event,url --limit 20

# Also check if there are any re-runs or earlier attempts
echo -e "\n=== Checking for workflow run attempts/reruns ==="
RUN_ID=18400513696
gh api repos/serverpod/relic/actions/runs/$RUN_ID --jq '{id: .id, run_attempt: .run_attempt, conclusion: .conclusion, status: .status}'

# Try to get job logs specifically for macOS jobs to see if there were any websocket test issues
echo -e "\n=== Detailed macOS job information ==="
gh run view 18400513696 --repo serverpod/relic --json jobs --jq '.jobs[] | select(.name | contains("macos")) | {name: .name, conclusion: .conclusion, steps: [.steps[] | {name: .name, conclusion: .conclusion}]}'

# Search the logs specifically for websocket and macos
echo -e "\n=== Searching logs for websocket-related content ==="
gh run view 18400513696 --repo serverpod/relic --log 2>&1 | grep -i "macos\|websocket" | head -50

Length of output: 15599


🏁 Script executed:

#!/bin/bash

# The run shows run_attempt: 2, which means there was a first failed attempt
# Let's try to get the jobs from attempt 1
echo "=== Attempting to get first run attempt details ==="
gh api repos/serverpod/relic/actions/runs/18400513696/attempts/1 --jq '{id: .id, run_attempt: .run_attempt, conclusion: .conclusion, status: .status}'

# Try to get the jobs from the first attempt
echo -e "\n=== Jobs from first run attempt ==="
gh api repos/serverpod/relic/actions/runs/18400513696/attempts/1/jobs --jq '.jobs[] | select(.conclusion == "failure") | {name: .name, conclusion: .conclusion, id: .id}'

# Get the specific job ID that failed
echo -e "\n=== Getting failed job details ==="
FAILED_JOB_ID=$(gh api repos/serverpod/relic/actions/runs/18400513696/attempts/1/jobs --jq '.jobs[] | select(.conclusion == "failure") | .id' | head -1)
echo "Failed Job ID: $FAILED_JOB_ID"

if [ ! -z "$FAILED_JOB_ID" ]; then
  echo -e "\n=== Failed job information ==="
  gh api repos/serverpod/relic/actions/jobs/$FAILED_JOB_ID --jq '{name: .name, conclusion: .conclusion, steps: [.steps[] | select(.conclusion == "failure") | {name: .name, conclusion: .conclusion}]}'
  
  # Get the logs for the failed job
  echo -e "\n=== Failed job logs ==="
  gh api repos/serverpod/relic/actions/jobs/$FAILED_JOB_ID/logs 2>&1 | grep -i -A 10 -B 10 "websocket\|fail\|error" | head -100
fi

Length of output: 7658


🏁 Script executed:

#!/bin/bash

# Create a GitHub issue to track the flaky websocket test
gh issue create \
  --repo serverpod/relic \
  --title "Flaky test: WebSocket ping interval test fails intermittently on macOS-latest" \
  --body "## Description

A flaky test was detected in the CI pipeline for PR #207.

## Test Details

**Test Name:** WebSocket Tests Given a web socket connection with a ping interval, when the client side blocks, then the server socket closes

**Location:** \`test/web_socket/web_socket_test.dart:354\`

**Platform:** macOS-latest (Dart stable, upgrade)

## Failure Details

The test failed on the first run attempt but passed on retry.

**Expected behavior:**
\`\`\`
• emit an event that <Instance of 'TextDataReceived'>
• emit an event that CloseReceived:<CloseReceived(1001, )>
• be done
\`\`\`

**Actual behavior:**
\`\`\`
emitted • CloseReceived(1001, )
x Stream closed.
which didn't emit an event that <Instance of 'TextDataReceived'>
\`\`\`

**Error:**
\`\`\`
TimeoutException after 0:00:30.000000: Test timed out after 30 seconds.
\`\`\`

## Links

- **PR:** #207
- **Failed workflow run:** https://github.com/serverpod/relic/actions/runs/18400513696
- **Failed job:** https://github.com/serverpod/relic/actions/runs/18400513696/job/52428473683
- **Related comment:** https://github.com/serverpod/relic/pull/207#discussion_r$(gh pr view 207 --repo serverpod/relic --json comments --jq '.comments[-1].databaseId')

## Observations

This appears to be a race condition or timing issue specific to macOS runners. The test expects to receive a \`TextDataReceived\` event before the \`CloseReceived\` event, but on macOS the close event is sometimes received first.

The test succeeded on retry, confirming its flaky nature.

## Suggested Actions

- Investigate the timing assumptions in the websocket ping interval test
- Consider adding more lenient timing expectations for macOS platform
- Review if the test's expectations about event ordering are too strict" \
  --assignee SandPod \
  --label "bug,flaky-test"

echo -e "\n=== Issue created successfully ==="

Length of output: 79


🏁 Script executed:

#!/bin/bash

# Get the most recently created issue to confirm it was created and get its number
echo "=== Getting the newly created issue details ==="
gh issue list --repo serverpod/relic --author "@me" --limit 1 --json number,title,url,labels

# Get the full issue details
ISSUE_NUM=$(gh issue list --repo serverpod/relic --author "@me" --limit 1 --json number --jq '.[0].number')
echo -e "\n=== Issue #$ISSUE_NUM details ==="
gh issue view $ISSUE_NUM --repo serverpod/relic

Length of output: 1809


🏁 Script executed:

#!/bin/bash

# Search for the websocket flaky test issue that should have just been created
echo "=== Searching for websocket-related issues ==="
gh issue list --repo serverpod/relic --search "websocket flaky" --limit 5 --json number,title,url,createdAt,author

# Also search for issues created in the last hour
echo -e "\n=== Recently created issues ==="
gh issue list --repo serverpod/relic --limit 10 --json number,title,url,createdAt,author,state --jq '.[] | select(.createdAt > "2025-10-10T08:00:00Z") | {number: .number, title: .title, author: .author.login, createdAt: .createdAt, url: .url}'

# Try to find the issue by searching for the title
echo -e "\n=== Searching by title keywords ==="
gh issue list --repo serverpod/relic --search "macOS ping interval" --state all --limit 5 --json number,title,url,state

Length of output: 122


🏁 Script executed:

#!/bin/bash

# Let's check all issues to see what happened
echo "=== All recent issues ==="
gh issue list --repo serverpod/relic --limit 10 --json number,title,url,createdAt

# Try creating the issue again with a simpler approach
echo -e "\n=== Creating issue for flaky websocket test ==="
gh issue create \
  --repo serverpod/relic \
  --title "Flaky test: WebSocket ping interval test fails intermittently on macOS-latest" \
  --assignee SandPod \
  --label "bug" \
  --body "## Description

A flaky test was detected in the CI pipeline for PR #207.

## Test Details

**Test Name:** WebSocket Tests Given a web socket connection with a ping interval, when the client side blocks, then the server socket closes

**Location:** \`test/web_socket/web_socket_test.dart:354\`

**Platform:** macOS-latest (Dart stable, upgrade)

## Failure Details

The test failed on the first run attempt but passed on retry.

**Expected behavior:**
\`\`\`
• emit an event that <Instance of 'TextDataReceived'>
• emit an event that CloseReceived:<CloseReceived(1001, )>
• be done
\`\`\`

**Actual behavior:**
\`\`\`
emitted • CloseReceived(1001, )
x Stream closed.
which didn't emit an event that <Instance of 'TextDataReceived'>
\`\`\`

**Error:**
\`\`\`
TimeoutException after 0:00:30.000000: Test timed out after 30 seconds.
\`\`\`

## Links

- **PR:** https://github.com/serverpod/relic/pull/207
- **Failed workflow run:** https://github.com/serverpod/relic/actions/runs/18400513696
- **Failed job:** https://github.com/serverpod/relic/actions/runs/18400513696/job/52428473683

## Observations

This appears to be a race condition or timing issue specific to macOS runners. The test expects to receive a \`TextDataReceived\` event before the \`CloseReceived\` event, but on macOS the close event is sometimes received first.

The test succeeded on retry, confirming its flaky nature.

## Suggested Actions

- Investigate the timing assumptions in the websocket ping interval test
- Consider adding more lenient timing expectations for macOS platform
- Review if the test's expectations about event ordering are too strict

---
Reported by: @SandPod in https://github.com/serverpod/relic/pull/207"

Length of output: 1854


🏁 Script executed:

#!/bin/bash

# Verify the issue was created successfully
echo "=== Verifying issue #208 ==="
gh issue view 208 --repo serverpod/relic --json number,title,url,body,assignees,labels

Length of output: 2137


@SandPod - I've created issue #208 to track the flaky websocket test that failed on macOS-latest during the first test run.

Issue Details:

The test failed initially because it didn't receive the expected TextDataReceived event before the CloseReceived event - it appears to be a timing/race condition specific to macOS runners. The test passed on the second attempt, confirming its flaky nature.

The issue includes:

  • Complete failure details and error messages
  • Links to the failed workflow run and job
  • Observations about the likely cause (race condition)
  • Suggested actions for investigation

🐰

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.

2 participants