Pass the anchor's ttl through to cloud anchor hosting - #36
Open
Brian-Simmons1 wants to merge 1 commit into
Open
Conversation
ARPlaneAnchor serializes a ttl field on the Dart side, but the native uploadAnchor handler never read it, so every cloud anchor was hosted with sceneview's 1-day default. Read the value (clamped to ARCore's 1-365 day range) and pass it to CloudAnchorNode.host. Found and fixed in production while building VEEOP (https://veeop.com), an AR social location platform - https://github.com/VEEOP-app
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
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.
ARPlaneAnchorserializes attlfield from Dart ('ttl': instance.ttlin the anchor'stoJson), but the nativeuploadAnchorhandler never reads it —CloudAnchorNode.host(session)is called without a TTL, so every cloud anchor is hosted with sceneview's 1-day default regardless of what the caller sets.This PR reads the serialized value, clamps it to ARCore's valid 1–365 day range, and passes it to
host(session, ttlDays). Behavior is unchanged for callers who don't setttl(default remains 1).Note for users: TTLs above 1 day require ARCore keyless (OAuth) authorization — API-key auth is capped at 1 day by Google.
Verified on device: hosting logs show the requested TTL and anchors resolve after the previous 1-day expiry window.
Found and fixed in production while building VEEOP, an AR social location platform (github.com/VEEOP-app).