Skip to content

Comments

feat: add support for heading in addWatch#10

Open
ItsChaceD wants to merge 6 commits intomainfrom
feat/RMET-4897/heading-support
Open

feat: add support for heading in addWatch#10
ItsChaceD wants to merge 6 commits intomainfrom
feat/RMET-4897/heading-support

Conversation

@ItsChaceD
Copy link

@ItsChaceD ItsChaceD commented Feb 2, 2026

Description

This PR adds support for heading, magneticHeading, trueHeading, headingAccuracy, and course

Context

https://outsystemsrd.atlassian.net/browse/RMET-4897

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Tests

Tested on Pixel 8 Pro with Capacitor example app, ODC sample app, and O11 sample app

@ItsChaceD ItsChaceD marked this pull request as ready for review February 5, 2026 16:19
@ItsChaceD ItsChaceD requested a review from a team February 5, 2026 16:19
@OS-pedrogustavobilro OS-pedrogustavobilro self-assigned this Feb 5, 2026
}

awaitClose {
sensorHandler.stop()
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm how about if a user sets multiple watches?

Would think this call would make more sense inside clearWatch when watchLocationHandlers is empty. But I guess then there's the case of the app closing, we'll want to unregister the listener as well?

Copy link
Author

Choose a reason for hiding this comment

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

Since sensorHandler tracks the watcherCount internally, it safely handles multiple watches. Tying it to awaitClose is a safer bet so we don't accidentally leak the sensor listeners if the app closes or the flow gets cancelled unexpectedly. If we relied solely on clearWatch, we would risk memory leaks whenever the user forgets to explicitly clear the watch

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, that's fair, but we're not calling sensorHandler.stop() on clearWatch, perhaps we should, or you don't think it's needed?

@OS-pedrogustavobilro OS-pedrogustavobilro changed the title feat: add support for heading feat: add support for heading in addWatch Feb 6, 2026
Copy link
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Choose a reason for hiding this comment

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

A few more comments, also I don't think you addressed / replied to all the above ones (I resolved the ones that are done)

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.

2 participants