Skip to content

Conversation

coodos
Copy link
Contributor

@coodos coodos commented Jul 7, 2025

Description of change

Issue Number

closes #252

Type of change

  • Breaking (any change that would cause existing functionality to not work as expected)
  • New (a change which implements a new feature)
  • Update (a change which updates existing functionality)
  • Fix (a change which fixes an issue)
  • Docs (changes to the documentation)
  • Chore (refactoring, build scripts or anything else that isn't user-facing)

How the change has been tested

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • Bug Fixes

    • Updated webhook handling to send POST requests to revised endpoint paths for improved routing in both Blabsy and Pictique APIs.
  • Style

    • Reformatted configuration file indentation and spacing for consistency.

Copy link
Contributor

coderabbitai bot commented Jul 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This change updates the webhook handling logic in two controller files to modify the URL construction for outgoing POST requests to the Anchr server. Instead of using environment variables for the path, the controllers now use hardcoded string segments. Additionally, the return statements for these POST requests were removed. One configuration file was reformatted for consistency.

Changes

Files Change Summary
infrastructure/eid-wallet/vite.config.js Reformatted indentation and spacing for consistent formatting; no logic changes.
platforms/blabsy-w3ds-auth-api/src/controllers/WebhookController.ts
platforms/pictique-api/src/controllers/WebhookController.ts
Changed webhook POST URL construction to use hardcoded path segments; removed return statements from POST calls.

Sequence Diagram(s)

sequenceDiagram
    participant ExternalService as External Service
    participant WebhookController as WebhookController
    participant AnchrServer as Anchr Server

    ExternalService->>WebhookController: Sends webhook event
    WebhookController->>AnchrServer: POST /blabsy or /pictique (base: ANCHR_URL)
    Note right of WebhookController: No early return after POST
Loading

Assessment against linked issues

Objective Addressed Explanation
Setup Anchr server to receive webhooks and forward to subscribers (#252)

Poem

A webhook hops from here to there,
With URLs tidied, code laid bare.
The Anchr server gets its post,
No early returns—no need to boast!
Indents aligned, the code is neat,
This rabbit’s work is quite a treat.
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d02dd18 and 516a6ca.

📒 Files selected for processing (2)
  • platforms/blabsy-w3ds-auth-api/src/controllers/WebhookController.ts (1 hunks)
  • platforms/pictique-api/src/controllers/WebhookController.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coodos coodos merged commit 9ac3873 into main Jul 7, 2025
0 of 3 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7ae582 and d02dd18.

⛔ Files ignored due to path filters (19)
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/.gitignore is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/AndroidProjectSystem.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/appInsightsSettings.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/compiler.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/deploymentTargetSelector.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/deviceManager.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/gradle.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/kotlinc.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/migrations.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/misc.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/runConfigurations.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/.idea/vcs.xml is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/app/build.gradle.kts is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/app/src/main/java/com/eid_wallet/app/MainActivity.kt is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/buildSrc/src/main/java/com/eid_wallet/app/kotlin/BuildTask.kt is excluded by !**/gen/**
  • infrastructure/eid-wallet/src-tauri/gen/android/buildSrc/src/main/java/com/eid_wallet/app/kotlin/RustPlugin.kt is excluded by !**/gen/**
  • pglite-debug.log is excluded by !**/*.log
  • platforms/blabsy/pglite-debug.log is excluded by !**/*.log
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .gitignore (1 hunks)
  • infrastructure/eid-wallet/vite.config.js (1 hunks)
  • platforms/blabsy-w3ds-auth-api/src/controllers/WebhookController.ts (4 hunks)
  • platforms/blabsy/.env.development (0 hunks)
  • platforms/pictique-api/src/controllers/WebhookController.ts (2 hunks)
  • platforms/pictique-api/src/web3adapter/controllers/WebhookController.ts (0 hunks)
  • platforms/pictique/vite.config.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • platforms/blabsy/.env.development
  • platforms/pictique-api/src/web3adapter/controllers/WebhookController.ts
🔇 Additional comments (6)
.gitignore (1)

8-9: LGTM! Good security practice.

Adding .env.development to .gitignore is the correct approach to prevent sensitive environment variables from being committed to version control.

infrastructure/eid-wallet/vite.config.js (1)

9-31: LGTM! Formatting improvements.

The changes consist of formatting and indentation improvements with no functional modifications. The configuration remains functionally identical.

platforms/pictique/vite.config.ts (1)

8-13: LGTM! Proper multi-environment configuration.

The addition of staging and production domains to allowedHosts follows a consistent naming pattern and properly supports multi-environment deployment.

platforms/pictique-api/src/controllers/WebhookController.ts (1)

11-11: LGTM! Proper import addition.

The axios import is correctly added for HTTP request functionality.

platforms/blabsy-w3ds-auth-api/src/controllers/WebhookController.ts (2)

7-7: LGTM! Proper import addition.

The axios import is correctly added for HTTP request functionality.


254-262: LGTM! Formatting improvements.

The formatting changes in the mapping methods improve code readability without affecting functionality.

Also applies to: 285-289

Comment on lines 32 to 34
if (process.env.ANCHR_URL) {
return axios.post(new URL(process.env.ANCHR_URL, process.env.PUBLIC_PICTIQUE_BASE_URL).toString(), req.body)
axios.post(new URL("blabsy", process.env.ANCHR_URL).toString(), req.body)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add error handling for webhook forwarding.

The axios POST request lacks error handling and is not awaited, which could lead to silent failures in cross-platform webhook forwarding.

-            if (process.env.ANCHR_URL) {
-                axios.post(new URL("blabsy", process.env.ANCHR_URL).toString(), req.body)
-            }
+            if (process.env.ANCHR_URL) {
+                try {
+                    await axios.post(new URL("blabsy", process.env.ANCHR_URL).toString(), req.body);
+                } catch (error) {
+                    console.error("Failed to forward webhook to blabsy:", error);
+                    // Continue processing despite forwarding failure
+                }
+            }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (process.env.ANCHR_URL) {
return axios.post(new URL(process.env.ANCHR_URL, process.env.PUBLIC_PICTIQUE_BASE_URL).toString(), req.body)
axios.post(new URL("blabsy", process.env.ANCHR_URL).toString(), req.body)
}
if (process.env.ANCHR_URL) {
try {
await axios.post(
new URL("blabsy", process.env.ANCHR_URL).toString(),
req.body
);
} catch (error) {
console.error("Failed to forward webhook to blabsy:", error);
// Continue processing despite forwarding failure
}
}
🤖 Prompt for AI Agents
In platforms/pictique-api/src/controllers/WebhookController.ts around lines 32
to 34, the axios POST request for webhook forwarding is neither awaited nor
wrapped in error handling, risking silent failures. Modify the code to await the
axios.post call and add a try-catch block to catch and log any errors during the
request, ensuring failures are properly handled and visible.

Comment on lines 90 to 92
if (process.env.ANCHR_URL) {
return axios.post(new URL(process.env.ANCHR_URL, process.env.PUBLIC_BLABSY_BASE_URL).toString(), req.body)
axios.post(new URL("pictique", process.env.ANCHR_URL).toString(), req.body)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add error handling for webhook forwarding.

The axios POST request lacks error handling and is not awaited, which could lead to silent failures in cross-platform webhook forwarding.

-            if (process.env.ANCHR_URL) {
-                axios.post(new URL("pictique", process.env.ANCHR_URL).toString(), req.body)
-            }
+            if (process.env.ANCHR_URL) {
+                try {
+                    await axios.post(new URL("pictique", process.env.ANCHR_URL).toString(), req.body);
+                } catch (error) {
+                    console.error("Failed to forward webhook to pictique:", error);
+                    // Continue processing despite forwarding failure
+                }
+            }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (process.env.ANCHR_URL) {
return axios.post(new URL(process.env.ANCHR_URL, process.env.PUBLIC_BLABSY_BASE_URL).toString(), req.body)
axios.post(new URL("pictique", process.env.ANCHR_URL).toString(), req.body)
}
if (process.env.ANCHR_URL) {
try {
await axios.post(
new URL("pictique", process.env.ANCHR_URL).toString(),
req.body
);
} catch (error) {
console.error("Failed to forward webhook to pictique:", error);
// Continue processing despite forwarding failure
}
}
🤖 Prompt for AI Agents
In platforms/blabsy-w3ds-auth-api/src/controllers/WebhookController.ts around
lines 90 to 92, the axios POST request to forward the webhook is neither awaited
nor wrapped in error handling, risking silent failures. Modify the code to await
the axios.post call and add a try-catch block to catch and log any errors that
occur during the request, ensuring failures are detected and handled properly.

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.

[feature] Feature staging environment with Anchr setup
1 participant