-
Notifications
You must be signed in to change notification settings - Fork 0
feat: send onDone notifications during init #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This sends `onBegin` and `onDone` during init for files which have already been completed in a previous session
|
Caution Review failedThe pull request is closed. WalkthroughPre-commit hook now runs tests after lint-staged. README clarifies init lifecycle: onBegin/onDone are invoked for pre-downloaded files. Jest adds 100% coverage thresholds and collection config. Core logic updates handle finished specs by verifying on-disk files, emitting onBegin/onDone, or restarting downloads. Tests cover these scenarios. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor App as App Init
participant Q as DownloadQueue
participant S as Spec Store
participant FS as File System
participant H as Handlers
App->>Q: initialize()/resume()
Q->>S: load specs
loop for each spec
alt spec.createTime <= 0
Q-->>Q: skip (lazy-deleted)
else spec.finished == true
Q->>FS: stat(spec.filePath)
alt file exists
rect rgb(230,245,255)
note over Q,H: Notify finished spec discovered during init
Q-->>H: onBegin(spec)
Q-->>H: onDone(spec)
end
else file missing
Q-->>Q: spec.finished = false
Q->>S: persist(spec)
Q-->>Q: start download(spec)
end
else not finished
Q-->>Q: start download(spec)
end
end
sequenceDiagram
autonumber
actor Sys as Resume Existing Task
participant Q as DownloadQueue
participant S as Spec Store
participant FS as File System
participant H as Handlers
Sys->>Q: reviveTask(taskId)
Q->>S: get spec by task
alt no spec
Q-->>Sys: return
else spec.finished == true and spec.createTime > 0
Q->>FS: stat(spec.filePath)
alt file exists
rect rgb(230,245,255)
note over Q,H: Revived finished spec
Q-->>H: onBegin(spec)
Q-->>H: onDone(spec)
end
else missing
Q-->>Q: spec.finished = false
Q->>S: persist(spec)
Q-->>Q: restart download(spec)
end
else proceed with normal continuation
Q-->>Q: resume task/download
end
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (5)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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. Comment |
|
🎉 This PR is included in version 5.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This sends
onBeginandonDoneduring init for files which have already been completed in aprevious session