Skip to content

Conversation

sabman
Copy link
Member

@sabman sabman commented Sep 19, 2025

No description provided.

…base integration

- Fix taskOrTasks not being sent to geoai.pipeline() by passing tasks during initialization
- Add pipeline caching based on provider and task combinations
- Fix race condition in session creation preventing detection results from being saved
- Add comprehensive debugging and logging for troubleshooting
- Add DatabaseDebugger component for testing database connectivity
- Improve error handling and user feedback for authentication issues
- Update InteractiveMap to only enable oil tank detection by default to avoid task chaining errors

Resolves issues with:
- Detection results not being saved to Supabase database
- TaskOrTasks parameter not being properly passed to AI pipeline
- Session state race conditions during auto-save
- Task chaining validation errors with multiple independent tasks
- Add architecture diagrams for both Standard Supabase and Geobase backends
- Explain vector tileserver advantages with Geobase
- Update setup instructions for both backend options
- Document automatic backend detection based on URL
- Clarify that Geobase is a backend alternative, not a map provider
Copy link

vercel bot commented Sep 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
geobase-ai-js-docs Ready Ready Preview Comment Sep 27, 2025 9:48pm
geobase-geoai-js-examples Ready Ready Preview Comment Sep 27, 2025 9:48pm


try {
// Determine attribution based on imagery source
const isOinHotosmImagery = geobaseConfig.cogImageryUrl.includes('oin-hotosm-temp.s3.us-east-1.amazonaws.com');

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High

'
oin-hotosm-temp.s3.us-east-1.amazonaws.com
' can be anywhere in the URL, and arbitrary hosts may come before or after it.

Copilot Autofix

AI 9 days ago

To correctly check if the imagery comes from the intended host, first parse the URL in geobaseConfig.cogImageryUrl and then compare its host with 'oin-hotosm-temp.s3.us-east-1.amazonaws.com'. This prevents false matches from substrings embedded elsewhere in the URL (path, query, etc.). You should use the standard URL constructor available in JavaScript/TypeScript to safely extract the host. Replace the substring .includes() test with a direct comparison (equality) or explicit whitelist check of the parsed host.

The region to change is line 459, and possibly a variable definition for the hostname string (either inline or declared above for clarity). No new dependencies are required; the global URL class is available in modern browsers and Node.js.


Suggested changeset 1
examples/04-geoai-supabase-geobase-integration/src/components/InteractiveMap.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/examples/04-geoai-supabase-geobase-integration/src/components/InteractiveMap.tsx b/examples/04-geoai-supabase-geobase-integration/src/components/InteractiveMap.tsx
--- a/examples/04-geoai-supabase-geobase-integration/src/components/InteractiveMap.tsx
+++ b/examples/04-geoai-supabase-geobase-integration/src/components/InteractiveMap.tsx
@@ -456,8 +456,15 @@
         
         try {
         // Determine attribution based on imagery source
-        const isOinHotosmImagery = geobaseConfig.cogImageryUrl.includes('oin-hotosm-temp.s3.us-east-1.amazonaws.com');
-        const attribution = isOinHotosmImagery 
+        let isOinHotosmImagery = false;
+        try {
+          const urlObj = new URL(geobaseConfig.cogImageryUrl);
+          isOinHotosmImagery = urlObj.host === 'oin-hotosm-temp.s3.us-east-1.amazonaws.com';
+        } catch (e) {
+          // Invalid URL or parsing error: treat as not OpenAerialMap
+          isOinHotosmImagery = false;
+        }
+        const attribution = isOinHotosmImagery
           ? 'Geobase Backend | © OpenAerialMap contributors'
           : 'Geobase Backend';
         
EOF
@@ -456,8 +456,15 @@

try {
// Determine attribution based on imagery source
const isOinHotosmImagery = geobaseConfig.cogImageryUrl.includes('oin-hotosm-temp.s3.us-east-1.amazonaws.com');
const attribution = isOinHotosmImagery
let isOinHotosmImagery = false;
try {
const urlObj = new URL(geobaseConfig.cogImageryUrl);
isOinHotosmImagery = urlObj.host === 'oin-hotosm-temp.s3.us-east-1.amazonaws.com';
} catch (e) {
// Invalid URL or parsing error: treat as not OpenAerialMap
isOinHotosmImagery = false;
}
const attribution = isOinHotosmImagery
? 'Geobase Backend | © OpenAerialMap contributors'
: 'Geobase Backend';

Copilot is powered by AI and may make mistakes. Always verify output.
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.

1 participant