Skip to content

Conversation

@ENvironmentSet
Copy link
Collaborator

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Dec 16, 2025

🦋 Changeset detected

Latest commit: e648ea0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@stackflow/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ENvironmentSet ENvironmentSet enabled auto-merge (squash) December 16, 2025 11:28
@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved promise state tracking for more reliable data loading and error handling.
    • Enhanced error detection and reporting in the loader system for better diagnostics.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

These changes modify promise handling in @stackflow/react. The SyncInspectablePromise utility now accepts Promise instead of PromiseLike, adds early-return optimization when input already has valid status, introduces a new reject function, and simplifies resolve logic. The loader plugin is updated to consistently use the new resolve approach instead of conditional promise handling.

Changes

Cohort / File(s) Summary
Changeset documentation
\.changeset/early-eggs-lie.md
New patch release changeset for @stackflow/react documenting state tracking instrument attachment to promises.
Promise inspection utility
integrations/react/src/__internal__/utils/SyncInspectablePromise.ts
Updated makeSyncInspectable signature from PromiseLike<T> to Promise<T>; added early-return optimization when input already has valid status; simplified Promise construction to directly use provided instance; introduced new public reject(error: unknown) function; unified resolve logic to consistently route through makeSyncInspectable.
Loader plugin integration
integrations/react/src/future/loader/loaderPlugin.tsx
Replaced conditional promise-like handling with consistent resolve(loadData(...)) + Promise.allSettled workflow; removed isPromiseLike check; simplified error handling path to always process settled results.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • SyncInspectablePromise.ts: Verify the API change from PromiseLike<T> to Promise<T> is applied consistently across all call sites; validate early-return logic for status detection; confirm new reject function integrates properly with existing promise state tracking.
  • loaderPlugin.tsx: Confirm the new resolve() pattern correctly handles both Promise and non-Promise values; verify error handling with Promise.allSettled produces expected outcomes.
  • Cross-file consistency: Ensure the unified promise handling pattern is correctly applied and doesn't introduce unexpected state tracking behavior.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-initial-loaders-causing-infinite-loop

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ba7fa13 and e648ea0.

📒 Files selected for processing (3)
  • .changeset/early-eggs-lie.md (1 hunks)
  • integrations/react/src/__internal__/utils/SyncInspectablePromise.ts (2 hunks)
  • integrations/react/src/future/loader/loaderPlugin.tsx (1 hunks)

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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 16, 2025

commit: e648ea0

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 16, 2025

Deploying stackflow-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 601c0c0
Status: ✅  Deploy successful!
Preview URL: https://b594cc9e.stackflow-demo.pages.dev
Branch Preview URL: https://fix-initial-loaders-causing.stackflow-demo.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 16, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
stackflow-docs e648ea0 Commit Preview URL Dec 16 2025, 11:35 AM

@ENvironmentSet ENvironmentSet merged commit 43cd76c into main Dec 16, 2025
6 of 9 checks passed
@ENvironmentSet ENvironmentSet deleted the fix-initial-loaders-causing-infinite-loop branch December 16, 2025 11:32
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