fix(functions): use app-id-based path for functions.fetch()#147
fix(functions): use app-id-based path for functions.fetch()#147netanelgilad wants to merge 1 commit intomainfrom
Conversation
functions.fetch() was using the domain-based path `/api/functions/{path}`
which relies on host-based app resolution. This fails against non-production
servers (deploy previews, staging) where the host doesn't map to an app.
Switch to the app-id-based path `/api/apps/{appId}/functions/{path}`,
matching the pattern invoke() already uses. This makes functions.fetch()
work correctly regardless of which server URL is configured.
Made-with: Cursor
|
Claude finished @netanelgilad's task —— View job Code Review for PR #147SummaryThis PR successfully addresses the issue with Review Checklist
Code Quality and Best Practices ✅The implementation is clean and follows established patterns:
Potential Bugs or Issues ✅No bugs identified. The change is straightforward and low-risk:
Performance Considerations ✅No performance impact:
Security Concerns ✅No security issues identified:
Test Coverage ✅Excellent test coverage:
Additional Observations
RecommendationApproved ✅ - This is a well-executed fix that solves the stated problem without introducing any risks or side effects. The implementation is correct, the tests are comprehensive, and the change improves consistency across the functions module. |
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/sdk@0.8.22-pr.147.4a9b875Prefer not to change any import paths? Install using npm alias so your code still imports npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.22-pr.147.4a9b875"Or add it to your {
"dependencies": {
"@base44/sdk": "npm:@base44-preview/sdk@0.8.22-pr.147.4a9b875"
}
}
Preview published to npm registry — try new features instantly! |
Summary
functions.fetch()was using the domain-based path (/api/functions/{path}) which relies on the host header to resolve the app. This fails against non-production servers (deploy previews, staging) where the host doesn't map to any app./api/apps/{appId}/functions/{path}), matching the patterninvoke()already uses. This makesfunctions.fetch()work correctly regardless of which server URL is configured.Test plan
Made with Cursor