-
Notifications
You must be signed in to change notification settings - Fork 3
feat(hermes): send OnNewDoc event #691
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
Open
no30bit
wants to merge
4
commits into
main
Choose a base branch
from
feat/629/send-on-new-doc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cong-or
added a commit
that referenced
this pull request
Nov 25, 2025
Replace async hermes-ipfs library with synchronous WIT bindings (file_add, file_pin, pubsub_publish, pubsub_subscribe). Add actual channel subscription in SyncChannel::new() and document complete pub/sub flow with PR #691 infrastructure. Changes: - Use WIT IPFS functions directly instead of async library - Call pubsub_subscribe() to register DocSync subscriptions - Document how on_new_doc events are triggered by PR #691 - Remove conditional compilation and async dependencies - Show clear 4-step workflow: add → pin → validate → publish
cong-or
added a commit
that referenced
this pull request
Nov 25, 2025
Fix compilation error and clarify that publishing to PubSub works now; PR #691 is only needed to route incoming messages to event handlers.
cong-or
added a commit
that referenced
this pull request
Nov 27, 2025
* feat: implement doc-sync channel::post API for issue #628 - Add channel::post(document_bytes) API as requested - Integrate hermes-ipfs library for IPFS operations - Add HTTP endpoints for testing (/api/doc-sync/*) - Configure HTTP gateway routing - Implement IPFS add, pin, and PubSub publish workflow * feat: implement doc-sync channel::post API for issue #628 - Add channel::post(document_bytes) API as requested - Integrate hermes-ipfs library for IPFS operations - Add HTTP endpoints for testing (/api/doc-sync/*) - Configure HTTP gateway routing - Implement IPFS add, pin, and PubSub publish workflow * hermes ipfs version * fix: enable WASM compilation for doc-sync module and add host stubs WASM compilation fixes: - Made tokio runtime features conditional (rt-multi-thread only for non-WASM) - Added separate WASM/native implementations using futures::executor for WASM - Conditionally compile Runtime usage and block_on calls Host implementation: - Replaced panicking todo!() with warning messages and stub return values - Added Resource stub creation for SyncChannel::new() - Functions now print warnings but don't crash runtime This allows the doc-sync module to compile for wasm32-wasip2 targets and run without panicking, though full functionality requires proper host implementation. * Remove all cfg attributes and consolidate WASM/non-WASM code paths into single implementations using futures::executor. Simplify HTTP handlers and reduce complexity to clearly demonstrate the 4-step workflow. * refactor(doc-sync): simplify for demo workflow Remove conditional compilation, OnceLock pattern, and unnecessary complexity to clearly show the 4-step IPFS PubSub workflow. * refactor(doc-sync): use WIT bindings directly for demo Replace async hermes-ipfs library with direct WIT function calls (file_add, file_pin, pubsub_publish). Remove conditional compilation and async dependencies to simplify the 4-step workflow demo. * refactor(doc-sync): use WIT bindings directly for demo Replace async hermes-ipfs library with direct WIT function calls (file_add, file_pin, pubsub_publish). Remove conditional compilation and async dependencies to simplify the 4-step workflow demo. * refactor(doc-sync): integrate with PR #691 subscription flow Replace async hermes-ipfs library with synchronous WIT bindings (file_add, file_pin, pubsub_publish, pubsub_subscribe). Add actual channel subscription in SyncChannel::new() and document complete pub/sub flow with PR #691 infrastructure. Changes: - Use WIT IPFS functions directly instead of async library - Call pubsub_subscribe() to register DocSync subscriptions - Document how on_new_doc events are triggered by PR #691 - Remove conditional compilation and async dependencies - Show clear 4-step workflow: add → pin → validate → publish * docs(doc-sync): document PR #691 integration requirements Add comprehensive comments explaining PR #691 requirement for subscription event routing. Document the complete pub/sub flow, what works now vs what needs PR #691, and how to integrate when it merges * fix(doc-sync): import GuestSyncChannel trait and clarify PR #691 comment Fix compilation error and clarify that publishing to PubSub works now; PR #691 is only needed to route incoming messages to event handlers. * update docs * refactor(doc-sync): Focus module on publishing workflow only Remove subscription logic and simplify documentation. Module now demonstrates only the 4-step publishing workflow: file_add, file_pin, pre-publish validation, and pubsub_publish. * fmt * refactor(doc-sync): Move post logic to host Execute the 4-step publishing workflow (file_add, file_pin, pre-publish, pubsub_publish) on the host side instead of in the WASM module. Reduces boundary crossings from 6 to 2 for better performance. * fmt * fmt * fix(doc-sync): Fix compilation errors - Fix SyncChannel resource import and usage - Update channel::post() to call host implementation correctly * refactor(doc-sync): Replace eprintln with tracing Use tracing macros (info/warn/error) instead of eprintln for logging in doc-sync host implementation. * refactor(doc-sync): Replace eprintln with tracing Use tracing macros (info/warn/error) instead of eprintln for logging in doc-sync host implementation. * fmt * refactor(doc-sync): Extract constants and improve error logging - Add DOC_SYNC_TOPIC and DOC_SYNC_CHANNEL constants - Add error logging to id_for() method * refactor(doc-sync): Improve error logging and remove redundant conversions - Log actual error details instead of discarding with - Remove redundant .to_string() on CID response - Add error logging for failed post operations * fmt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Send OnNewDoc event to guests.
Related Issue(s)
Closes #629
Description of Changes
Breaking Changes
Describe any breaking changes and the impact.
Screenshots
If applicable, add screenshots to help explain your changes.
Related Pull Requests
If applicable, list any related pull requests.
Please confirm the following checks