openScale icon indicating copy to clipboard operation
openScale copied to clipboard

Bugs in v3.0 beta (assorted)

Open TheRedWolf opened this issue 1 year ago • 29 comments

Found a few bugs in version 3.0 so far...

When adding a new measurement, selecting any editable field displays German language items where english language items should be.

Reproduction steps: Ensure app language is set to "English" under Settings - General Return to Overview, select + to add a new entry. Choose any editable field and tap the pencil to edit it.

For date, Abbrechen is displayed instead of Cancel For all value fields (weight etc), Wert eingeben is displayed instead of Enter value, and as with date, Abbrechen is displayed instead of Cancel.


I've also been unable to connect my Beurer BF950 scale properly. Bluetooth all seems to work as intended, however I'm presented with the option to "Select User on Scale", which then states "Error: User data could not be loaded correctly"

From the logs it would appear user profiles are being retrieved, but something is going wrong upstream when trying to handle them... Below is the relevant log snippet where the CHOOSE_USER function is triggered, followed by me disconnecting the device again after being presented with the error message. Resetting/clearing local database does nothing to correct this either.

`2025-08-14 15:47:57.096 D/BluetoothStandardWeightProfile: stepNr: 10 SET_NOTIFY_VENDOR_SPECIFIC_USER_LIST 2025-08-14 15:47:57.096 D/BluetoothCommunication: Step Nr 10 2025-08-14 15:47:57.095 D/BluetoothCommunication: Invoke set notification on 0x2a19 "battery level" 2025-08-14 15:47:57.096 D/BluetoothCommunication: Invoke set notification on 0x0001 2025-08-14 15:47:57.094 D/BluetoothStandardWeightProfile: stepNr: 8 SET_NOTIFY_BATTERY_LEVEL 2025-08-14 15:47:57.095 D/BluetoothCommunication: Step Nr 9 2025-08-14 15:47:57.097 D/BluetoothCommunication: Stop machine state 2025-08-14 15:47:57.333 D/BluetoothCommunication: SUCCESS: Notify set for 00000001-0000-1000-8000-00805f9b34fb 2025-08-14 15:47:57.333 D/BluetoothCommunication: Resume machine state 2025-08-14 15:47:57.333 D/BluetoothCommunication: Step Nr 11 2025-08-14 15:47:57.333 D/BluetoothStandardWeightProfile: stepNr: 11 REQUEST_VENDOR_SPECIFIC_USER_LIST 2025-08-14 15:47:57.333 D/BluetoothCommunication: Invoke write bytes [00] on 0x0001 2025-08-14 15:47:57.334 D/BluetoothCommunication: Stop machine state 2025-08-14 15:47:57.572 D/BluetoothCommunication: SUCCESS: Writing <00> to <00000001-0000-1000-8000-00805f9b34fb> 2025-08-14 15:47:57.812 D/BluetoothStandardWeightProfile: Got user data: <00 01 47 50 20 C1 07 05 11 BD 00 03> 2025-08-14 15:47:58.048 D/BluetoothStandardWeightProfile: Got user data: <00 02 50 30 32 BC 07 01 01 AA 00 03> 2025-08-14 15:47:58.293 D/BluetoothStandardWeightProfile: Got user data: <01> 2025-08-14 15:47:58.293 D/BluetoothStandardWeightProfile: scale user list: 2025-08-14 15:47:58.294 D/BluetoothStandardWeightProfile: 2. com.health.openscale.core.bluetooth.data.ScaleUser@7a9bb2d 2025-08-14 15:47:58.295 D/BluetoothCommunication: Sending USER_INTERACTION_REQUIRED (CHOOSE_USER) to handler. Data: Pair{[Ljava.lang.String;@c1a9862 [I@f8cedf3} 2025-08-14 15:47:58.294 D/BluetoothStandardWeightProfile:

  1. com.health.openscale.core.bluetooth.data.ScaleUser@ac5ce44 2025-08-14 15:47:58.295 D/LegacyScaleAdapter: DriverEventHandler: Message received - what: 9 (USER_INTERACTION_REQUIRED), obj: [Ljava.lang.Object;@c738ab0, arg1: 0, arg2: 0 2025-08-14 15:47:58.295 D/LegacyScaleAdapter: USER_INTERACTION_REQUIRED (CHOOSE_USER) for C8:B2:1E:A1:D9:D3. Forwarding data: Pair{[Ljava.lang.String;@c1a9862 [I@f8cedf3} 2025-08-14 15:47:58.296 D/BluetoothConnManager: BluetoothEvent received: UserInteractionRequired(deviceIdentifier=C8:B2:1E:A1:D9:D3, data=Pair{[Ljava.lang.String;@c1a9862 [I@f8cedf3}, interactionType=CHOOSE_USER) for BF950 2025-08-14 15:47:58.296 I/BluetoothConnManager: Event: UserInteractionRequired (CHOOSE_USER) for C8:B2:1E:A1:D9:D3. Data: Pair{[Ljava.lang.String;@c1a9862 [I@f8cedf3} 2025-08-14 15:48:00.408 D/BluetoothViewModel: Requesting to clear pending user interaction event. 2025-08-14 15:48:07.099 I/BluetoothViewModel: User requested to disconnect device. Delegating to BluetoothConnectionManager. 2025-08-14 15:48:07.099 I/BluetoothConnManager: disconnect() called for BF950. Active communicator: true, Status: CONNECTED 2025-08-14 15:48:07.100 I/LegacyScaleAdapter: disconnect: REQUEST for C8:B2:1E:A1:D9:D3 2025-08-14 15:48:07.100 V/SharedViewModel: Snackbar requested (String): "Disconnecting from BF950…" (UI Event) 2025-08-14 15:48:07.100 D/BluetoothCommunication: Bluetooth disconnect `

TheRedWolf avatar Aug 14 '25 06:08 TheRedWolf

When adding a new measurement, selecting any editable field displays German language items where english language items should be.

Thanks for the hint it is fixed with commit 38185c26c980ab7ae1b234948f95911c180e7dff

I've also been unable to connect my Beurer BF950 scale properly. Bluetooth all seems to work as intended, however I'm presented with the option to "Select User on Scale", which then states "Error: User data could not be loaded correctly"

From the logs it would appear user profiles are being retrieved, but something is going wrong upstream when trying to handle them... Below is the relevant log snippet where the CHOOSE_USER function is triggered, followed by me disconnecting the device again after being presented with the error message. Resetting/clearing local database does nothing to correct this either.

Did you see in the app a dialog which popped up? I added some logs in the latest beta build with commit 841dcf04fc9f2015455305010e2d7a036f35b994 Could you post the log file again with the latest beta build?

oliexdev avatar Aug 14 '25 11:08 oliexdev

Did you see in the app a dialog which popped up? I added some logs in the latest beta build with commit 841dcf0 Could you post the log file again with the latest beta build?

Only the one saying "Select User on Scale" with the error message that user data could not be loaded correctly.

I cloned the v3.0 branch and finally got my local dev environment working through Android Studio and did a bit of remote debugging, this specific if statement appears to be evaluating as false for some reason... Not being particularly familiar with kotlin or java I'm not yet sure why, but I'll compile this version and see whether I can grab some more clues.

if (choicesData is Pair<*, *> && choicesData.first is Array<*> && choicesData.second is IntArray)

TheRedWolf avatar Aug 14 '25 11:08 TheRedWolf

Latest commits still have the same thing happening, gets to the if statement which evaluates as false, kicking past all the fun stuff and going straight to the else statement at the bottom. Grabbed a screenshot of what choicesData gets set to from my scale, I've set a temporary profile on it instead of my actual data (hence the odd birthday)

Image

TheRedWolf avatar Aug 14 '25 11:08 TheRedWolf

Latest commits still have the same thing happening, gets to the if statement which evaluates as false, kicking past all the fun stuff and going straight to the else statement at the bottom. Grabbed a screenshot of what choicesData gets set to from my scale, I've set a temporary profile on it instead of my actual data (hence the odd birthday)

Image

thanks for the screenshot could you try to replace

if (choicesData is Pair<*, *> && choicesData.first is Array<*> && choicesData.second is IntArray)

with

if (choicesData is android.util.Pair<*, *> && choicesData.first is Array<*> && choicesData.second is IntArray) {

I might be the problem that the Pair was a Java pair and not a kotlin.Pair.

oliexdev avatar Aug 14 '25 12:08 oliexdev

if (choicesData is Pair<*, *> && choicesData.first is Array<*> && choicesData.second is IntArray)

with

if (choicesData is android.util.Pair<*, *> && choicesData.first is Array<*> && choicesData.second is IntArray) {

I might be the problem that the Pair was a Java pair and not a kotlin.Pair.

That did the trick, although it crashed out two lines down until I changed this too.

val choices = choicesData as Pair<Array<CharSequence>, IntArray> to val choices = choicesData as android.util.Pair<Array<CharSequence>, IntArray>

This gave me the values I expected from the scales, both the user record and the option to create a new user on scale. I've selected my existing user and hit confirm, but I'm now getting prompted for the confirmation code... It seems to be impossible to type anything in the input field, which stays blank even when trying to paste a number in. Hitting cancel shows an error message which is in German (Benutzereingabe verarbeitet)

TheRedWolf avatar Aug 14 '25 12:08 TheRedWolf

This gave me the values I expected from the scales, both the user record and the option to create a new user on scale. I've selected my existing user and hit confirm, but I'm now getting prompted for the confirmation code... It seems to be impossible to type anything in the input field, which stays blank even when trying to paste a number in. Hitting cancel shows an error message which is in German (Benutzereingabe verarbeitet)

Thanks we are getting closer, could you try to change the following:

remove selectedUserIndexState = Int.MIN_VALUE and consentCodeInput = ""

when (interactionEvent.interactionType) {
    UserInteractionType.CHOOSE_USER -> {
        dialogTitle = stringResource(R.string.dialog_bt_interaction_title_choose_user)
        dialogIcon = { Icon(Icons.Filled.People, contentDescription = stringResource(R.string.dialog_bt_icon_desc_choose_user)) }
        // ❌ REMOVE this line
        selectedUserIndexState = Int.MIN_VALUE
    }
    UserInteractionType.ENTER_CONSENT -> {
        dialogTitle = stringResource(R.string.dialog_bt_interaction_title_enter_consent)
        dialogIcon = { Icon(Icons.Filled.HowToReg, contentDescription = stringResource(R.string.dialog_bt_icon_desc_enter_consent)) }
        // ❌ REMOVE this line
        consentCodeInput = ""
    }
}

and change var consentCodeInput and var selectedUserIndexState to:

var consentCodeInput by rememberSaveable(interactionEvent.interactionType) { mutableStateOf("") }
var selectedUserIndexState by rememberSaveable(interactionEvent.interactionType) { mutableIntStateOf(Int.MIN_VALUE) }

so it looks like:

        var consentCodeInput by rememberSaveable(interactionEvent.interactionType) { mutableStateOf("") }
        var selectedUserIndexState by rememberSaveable(interactionEvent.interactionType) { mutableIntStateOf(Int.MIN_VALUE) }

        when (interactionEvent.interactionType) {
            UserInteractionType.CHOOSE_USER -> {
                dialogTitle = stringResource(R.string.dialog_bt_interaction_title_choose_user)
                dialogIcon = { Icon(Icons.Filled.People, contentDescription = stringResource(R.string.dialog_bt_icon_desc_choose_user)) }
            }
            UserInteractionType.ENTER_CONSENT -> {
                dialogTitle = stringResource(R.string.dialog_bt_interaction_title_enter_consent)
                dialogIcon = { Icon(Icons.Filled.HowToReg, contentDescription = stringResource(R.string.dialog_bt_icon_desc_enter_consent)) }
            }
            // else -> { /* Handle unknown types or provide defaults */ } // Optional
        }

oliexdev avatar Aug 14 '25 13:08 oliexdev

Well input is now possible, but it just loops on selecting confirm. I'm definitely putting the correct consent code in as well.

Nothing particularly obvious standing out in the code we've changed, but I did spot this in logcat... It makes me suspect that while the consent code is being collected, the variable is getting set afterwards to -1 (along with userIndex), which of course is then failing to authorize...

Requesting to clear pending user interaction event.
Forwarding user interaction feedback to communicator: type=ENTER_CONSENT, appUserId=1
Processing UserInteractionFeedback: ENTER_CONSENT for appUserId: 1
ENTER_CONSENT Feedback: scaleUserConsent = 8664
Jump next to step nr 13
Resume machine state
Step Nr 13
stepNr: 13 SELECT_SCALE_USER
Select user on scale!
setting: userId 0, userIndex: -1, consent Code: -1 
setUser userIndex: -1, consentCode: -1
Invoke write bytes [02 FF FF FF] on 0x2a9f "user control point"
Stop machine state
Snackbar requested (String): "Benutzereingabe verarbeitet." (UI Event)
WindowManagerGlobal#removeView, ty=2, view=com.android.internal.policy.DecorView{725847e V.E...... R......D 0,0-1120,1057 aid=1073741917}[MainActivity], caller=android.view.WindowManagerGlobal.removeView:626 android.view.WindowManagerImpl.removeViewImmediate:216 android.app.Dialog.dismissDialog:808 
sendCancelIfRunning: isInProgress=false callback=android.view.ViewRootImpl$$ExternalSyntheticLambda15@f132661
endAllActiveAnimators on 0xb40000716f4d9e00 (UnprojectedRipple) with handle 0xb400007203ecbce0
dispatchDetachedFromWindow
Input channel destroyed: 'e0c4e64', fd=160
setRequestedVisibleTypes: visible=false, mask=ime, host=com.health.openscale.beta/com.health.openscale.MainActivity, from=android.view.ImeInsetsSourceConsumer.setControl:226 android.view.InsetsController.onControlsChanged:1154 android.view.ViewRootImpl.doDie:11978 android.view.ViewRootImpl.die:11923 android.view.WindowManagerGlobal.removeViewLocked:695 android.view.WindowManagerGlobal.removeView:626 android.view.WindowManagerImpl.removeViewImmediate:216 android.app.Dialog.dismissDialog:808 android.app.Dialog.dismiss:790 androidx.compose.ui.window.AndroidDialog_androidKt$Dialog$1$1$invoke$$inlined$onDispose$1.dispose:68 
com.health.openscale.beta:2b645c93: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false
hsifw() - flag : 0
com.health.openscale.beta:2b645c93: onFailed at PHASE_CLIENT_VIEW_SERVED
hsifw() ignored windowToken=null servedView=null mDisplayId=0
onStateChanged: host=com.health.openscale.beta/com.health.openscale.MainActivity, from=android.view.ViewRootImpl.handleInsetsControlChanged:2888, state=InsetsState: {mDisplayFrame=Rect(0, 0 - 1440, 3088), mDisplayCutout=DisplayCutout{insets=Rect(0, 100 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(685, 0 - 756, 100), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1440 displayHeight=3088 physicalDisplayWidth=1440 physicalDisplayHeight=3088 density={3.75} cutoutSpec={M 0,0 H -9.466666666666667 V 26.66666666666667‬ H 9.466666666666667 V 0 H 0 Z @dp} rotation={0} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}} sideOverrides={}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=14, center=Point(14, 14)}, RoundedCorner{position=TopRight, radius=14, center=Point(1426, 14)}, RoundedCorner{position=BottomRight, radius=14, center=Point(1426, 3074)}, RoundedCorner{position=BottomLeft, radius=14, center=Point(14, 3074)}]}  mRoundedCornerFrame=Rect(0, 0 - 1440, 3088), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(1286, 0 - 1440, 100) rotation=0}, mDisplayShape=DisplayShape{ spec=-311912193 displayWidth=1440 displayHeight=3088 physicalPixelDisplaySizeRatio=1.0 rotation=0 offsetX=0 offsetY=0 scale=1.0}, mSources= { InsetsSource: {c1c80001 mType=navigationBars mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80004 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags= mSideHint=NONE mBoundingRects=null}, InsetsSource: {c1c80005 mType=mandatorySystemGestures mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80006 mType=tappableElement mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80024 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags= mSideHint=NONE mBoundingRects=null}, InsetsSource: {27 mType=displayCutout mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70000 mType=statusBars mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70005 mType=mandatorySystemGestures mFrame=[0,0][1440,142] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70006 mType=tappableElement mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null} }
applyRequestedVisibilityToControl: visible=true, type=statusBars, host=com.health.openscale.beta/com.health.openscale.MainActivity
onStateChanged: host=com.health.openscale.beta/com.health.openscale.MainActivity, from=android.view.ViewRootImpl.handleResized:2789, state=InsetsState: {mDisplayFrame=Rect(0, 0 - 1440, 3088), mDisplayCutout=DisplayCutout{insets=Rect(0, 100 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(685, 0 - 756, 100), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1440 displayHeight=3088 physicalDisplayWidth=1440 physicalDisplayHeight=3088 density={3.75} cutoutSpec={M 0,0 H -9.466666666666667 V 26.66666666666667‬ H 9.466666666666667 V 0 H 0 Z @dp} rotation={0} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}} sideOverrides={}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=14, center=Point(14, 14)}, RoundedCorner{position=TopRight, radius=14, center=Point(1426, 14)}, RoundedCorner{position=BottomRight, radius=14, center=Point(1426, 3074)}, RoundedCorner{position=BottomLeft, radius=14, center=Point(14, 3074)}]}  mRoundedCornerFrame=Rect(0, 0 - 1440, 3088), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(1286, 0 - 1440, 100) rotation=0}, mDisplayShape=DisplayShape{ spec=-311912193 displayWidth=1440 displayHeight=3088 physicalPixelDisplaySizeRatio=1.0 rotation=0 offsetX=0 offsetY=0 scale=1.0}, mSources= { InsetsSource: {c1c80001 mType=navigationBars mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80004 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags= mSideHint=NONE mBoundingRects=null}, InsetsSource: {c1c80005 mType=mandatorySystemGestures mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80006 mType=tappableElement mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80024 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags= mSideHint=NONE mBoundingRects=null}, InsetsSource: {3 mType=ime mFrame=[0,1762][1440,3088] mVisible=false mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {27 mType=displayCutout mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70000 mType=statusBars mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70005 mType=mandatorySystemGestures mFrame=[0,0][1440,142] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70006 mType=tappableElement mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null} }
handleResized, frames=ClientWindowFrames{frame=[0,0][1440,3088] display=[0,0][1440,3088] parentFrame=[0,0][0,0]} displayId=0 dragResizing=false compatScale=1.0 frameChanged=false attachedFrameChanged=false configChanged=false displayChanged=false compatScaleChanged=false dragResizingChanged=false
applyRequestedVisibilityToControl: visible=true, type=navigationBars, host=com.health.openscale.beta/com.health.openscale.MainActivity
mThreadedRenderer.initializeIfNeeded()#2 mSurface={isValid=true 0xb400007203d71800}
startInputInner - Id : 0
startInputInner - IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus
requestCursorUpdates on inactive InputConnection
Input channel constructed: 'ClientS', fd=141
hide(ime(), fromIme=true)
com.health.openscale.beta:d5be7e6e: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
Ime callback not found. Ignoring unregisterReceivedCallback. callbackId: 230113278
SUCCESS: Writing <02 FF FF FF> to <00002a9f-0000-1000-8000-00805f9b34fb>
applyRequestedVisibilityToControl: visible=false, type=ime, host=com.health.openscale.beta/com.health.openscale.MainActivity
UDS_CP_CONSENT: Not authorized

TheRedWolf avatar Aug 14 '25 14:08 TheRedWolf

please try to change on both onDismissRequest from:

onDismissRequest = {
    if (interactionEvent.interactionType == UserInteractionType.ENTER_CONSENT) {
        bluetoothViewModel.processUserInteraction(interactionEvent.interactionType, -1)
    }
    bluetoothViewModel.clearPendingUserInteraction()
}

to

onDismissRequest = {
    bluetoothViewModel.clearPendingUserInteraction()
}

and from

            dismissButton = {
                TextButton(
                    onClick = {
    if (interactionEvent.interactionType == UserInteractionType.ENTER_CONSENT) {
                            bluetoothViewModel.processUserInteraction(interactionEvent.interactionType, -1) // -1 for abort signal
                        } else {
                            bluetoothViewModel.clearPendingUserInteraction()
                        }                    }
                ) {
                    Text(stringResource(R.string.cancel_button))
                }
            }

to

            dismissButton = {
                TextButton(
                    onClick = {
                        bluetoothViewModel.clearPendingUserInteraction()
                    }
                ) {
                    Text(stringResource(R.string.cancel_button))
                }
            }

oliexdev avatar Aug 14 '25 14:08 oliexdev

Tried the above changes, still same result in logcat... Something else is setting the consent code to -1 by the looks of it.

TheRedWolf avatar Aug 15 '25 01:08 TheRedWolf

Please provide the full log file

oliexdev avatar Aug 15 '25 03:08 oliexdev

Please provide the full log file

Whole log is extensive, here's the snippet from where the consent code failed...

I'm wondering whether it might be better to commit some of the fixes so far to make tweaking/testing code easier?

ViewPostIme key 0
ViewPostIme key 1
ViewPostIme key 0
ViewPostIme key 1
ViewPostIme key 0
ViewPostIme key 1
ViewPostIme key 0
ViewPostIme key 1
ViewPostIme pointer 0
onDisplayChanged oldDisplayState=2 newDisplayState=2
onDisplayChanged oldDisplayState=2 newDisplayState=2
ViewPostIme pointer 1
Requesting to clear pending user interaction event.
Forwarding user interaction feedback to communicator: type=ENTER_CONSENT, appUserId=1
Processing UserInteractionFeedback: ENTER_CONSENT for appUserId: 1
ENTER_CONSENT Feedback: scaleUserConsent = 8664
Jump next to step nr 13
Resume machine state
Step Nr 13
stepNr: 13 SELECT_SCALE_USER
Select user on scale!
setting: userId 0, userIndex: -1, consent Code: -1 
setUser userIndex: -1, consentCode: -1
Invoke write bytes [02 FF FF FF] on 0x2a9f "user control point"
Stop machine state
Snackbar requested (String): "Benutzereingabe verarbeitet." (UI Event)
WindowManagerGlobal#removeView, ty=2, view=com.android.internal.policy.DecorView{3fffc95 V.E...... R......D 0,0-1120,1057 aid=1073741840}[MainActivity], caller=android.view.WindowManagerGlobal.removeView:626 android.view.WindowManagerImpl.removeViewImmediate:216 android.app.Dialog.dismissDialog:808 
sendCancelIfRunning: isInProgress=false callback=android.view.ViewRootImpl$$ExternalSyntheticLambda15@7da8c94
endAllActiveAnimators on 0xb40000716fcb6800 (UnprojectedRipple) with handle 0xb4000071675ec2c0
dispatchDetachedFromWindow
Input channel destroyed: '6163726', fd=163
setRequestedVisibleTypes: visible=false, mask=ime, host=com.health.openscale.beta/com.health.openscale.MainActivity, from=android.view.ImeInsetsSourceConsumer.setControl:226 android.view.InsetsController.onControlsChanged:1154 android.view.ViewRootImpl.doDie:11978 android.view.ViewRootImpl.die:11923 android.view.WindowManagerGlobal.removeViewLocked:695 android.view.WindowManagerGlobal.removeView:626 android.view.WindowManagerImpl.removeViewImmediate:216 android.app.Dialog.dismissDialog:808 android.app.Dialog.dismiss:790 androidx.compose.ui.window.AndroidDialog_androidKt$Dialog$1$1$invoke$$inlined$onDispose$1.dispose:68 
com.health.openscale.beta:3dfb7d7a: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false
hsifw() - flag : 0
com.health.openscale.beta:3dfb7d7a: onFailed at PHASE_CLIENT_VIEW_SERVED
hsifw() ignored windowToken=null servedView=null mDisplayId=0
applyRequestedVisibilityToControl: visible=true, type=statusBars, host=com.health.openscale.beta/com.health.openscale.MainActivity
onStateChanged: host=com.health.openscale.beta/com.health.openscale.MainActivity, from=android.view.ViewRootImpl.handleInsetsControlChanged:2888, state=InsetsState: {mDisplayFrame=Rect(0, 0 - 1440, 3088), mDisplayCutout=DisplayCutout{insets=Rect(0, 100 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(685, 0 - 756, 100), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1440 displayHeight=3088 physicalDisplayWidth=1440 physicalDisplayHeight=3088 density={3.75} cutoutSpec={M 0,0 H -9.466666666666667 V 26.66666666666667‬ H 9.466666666666667 V 0 H 0 Z @dp} rotation={0} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}} sideOverrides={}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=14, center=Point(14, 14)}, RoundedCorner{position=TopRight, radius=14, center=Point(1426, 14)}, RoundedCorner{position=BottomRight, radius=14, center=Point(1426, 3074)}, RoundedCorner{position=BottomLeft, radius=14, center=Point(14, 3074)}]}  mRoundedCornerFrame=Rect(0, 0 - 1440, 3088), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(1286, 0 - 1440, 100) rotation=0}, mDisplayShape=DisplayShape{ spec=-311912193 displayWidth=1440 displayHeight=3088 physicalPixelDisplaySizeRatio=1.0 rotation=0 offsetX=0 offsetY=0 scale=1.0}, mSources= { InsetsSource: {c1c80001 mType=navigationBars mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80004 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags= mSideHint=NONE mBoundingRects=null}, InsetsSource: {c1c80005 mType=mandatorySystemGestures mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80006 mType=tappableElement mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80024 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags= mSideHint=NONE mBoundingRects=null}, InsetsSource: {27 mType=displayCutout mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70000 mType=statusBars mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70005 mType=mandatorySystemGestures mFrame=[0,0][1440,142] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70006 mType=tappableElement mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null} }
onStateChanged: host=com.health.openscale.beta/com.health.openscale.MainActivity, from=android.view.ViewRootImpl.handleResized:2789, state=InsetsState: {mDisplayFrame=Rect(0, 0 - 1440, 3088), mDisplayCutout=DisplayCutout{insets=Rect(0, 100 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(685, 0 - 756, 100), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1440 displayHeight=3088 physicalDisplayWidth=1440 physicalDisplayHeight=3088 density={3.75} cutoutSpec={M 0,0 H -9.466666666666667 V 26.66666666666667‬ H 9.466666666666667 V 0 H 0 Z @dp} rotation={0} scale={1.0} physicalPixelDisplaySizeRatio={1.0}}} sideOverrides={}}, mRoundedCorners=RoundedCorners{[RoundedCorner{position=TopLeft, radius=14, center=Point(14, 14)}, RoundedCorner{position=TopRight, radius=14, center=Point(1426, 14)}, RoundedCorner{position=BottomRight, radius=14, center=Point(1426, 3074)}, RoundedCorner{position=BottomLeft, radius=14, center=Point(14, 3074)}]}  mRoundedCornerFrame=Rect(0, 0 - 1440, 3088), mPrivacyIndicatorBounds=PrivacyIndicatorBounds {static bounds=Rect(1286, 0 - 1440, 100) rotation=0}, mDisplayShape=DisplayShape{ spec=-311912193 displayWidth=1440 displayHeight=3088 physicalPixelDisplaySizeRatio=1.0 rotation=0 offsetX=0 offsetY=0 scale=1.0}, mSources= { InsetsSource: {c1c80001 mType=navigationBars mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80004 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags= mSideHint=NONE mBoundingRects=null}, InsetsSource: {c1c80005 mType=mandatorySystemGestures mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80006 mType=tappableElement mFrame=[0,2920][1440,3088] mVisible=true mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {c1c80024 mType=systemGestures mFrame=[0,0][0,0] mVisible=true mFlags= mSideHint=NONE mBoundingRects=null}, InsetsSource: {3 mType=ime mFrame=[0,1762][1440,3088] mVisible=false mFlags= mSideHint=BOTTOM mBoundingRects=null}, InsetsSource: {27 mType=displayCutout mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70000 mType=statusBars mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70005 mType=mandatorySystemGestures mFrame=[0,0][1440,142] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null}, InsetsSource: {4ef70006 mType=tappableElement mFrame=[0,0][1440,100] mVisible=true mFlags= mSideHint=TOP mBoundingRects=null} }
handleResized, frames=ClientWindowFrames{frame=[0,0][1440,3088] display=[0,0][1440,3088] parentFrame=[0,0][0,0]} displayId=0 dragResizing=false compatScale=1.0 frameChanged=false attachedFrameChanged=false configChanged=false displayChanged=false compatScaleChanged=false dragResizingChanged=false
applyRequestedVisibilityToControl: visible=true, type=navigationBars, host=com.health.openscale.beta/com.health.openscale.MainActivity
mThreadedRenderer.initializeIfNeeded()#2 mSurface={isValid=true 0xb4000071d3099000}
startInputInner - Id : 0
startInputInner - IInputMethodManagerGlobalInvoker.startInputOrWindowGainedFocus
Input channel constructed: 'ClientS', fd=163
hide(ime(), fromIme=true)
com.health.openscale.beta:f9a08c50: onCancelled at PHASE_CLIENT_APPLY_ANIMATION
Ime callback not found. Ignoring unregisterReceivedCallback. callbackId: 227433260
requestCursorUpdates on inactive InputConnection
applyRequestedVisibilityToControl: visible=false, type=ime, host=com.health.openscale.beta/com.health.openscale.MainActivity
SUCCESS: Writing <02 FF FF FF> to <00002a9f-0000-1000-8000-00805f9b34fb>
UDS_CP_CONSENT: Not authorized
Sending USER_INTERACTION_REQUIRED (ENTER_CONSENT) to handler. Data: [Ljava.lang.Object;@2e144b1
DriverEventHandler: Message received - what: 9 (USER_INTERACTION_REQUIRED), obj: [Ljava.lang.Object;@ebe5d96, arg1: 0, arg2: 0
USER_INTERACTION_REQUIRED (ENTER_CONSENT) for C8:B2:1E:A1:D9:D3. Forwarding data: [Ljava.lang.Object;@2e144b1
BluetoothEvent received: UserInteractionRequired(deviceIdentifier=C8:B2:1E:A1:D9:D3, data=[Ljava.lang.Object;@2e144b1, interactionType=ENTER_CONSENT) for BF950

TheRedWolf avatar Aug 15 '25 04:08 TheRedWolf

Poking around in debugging, as far as I can tell when it gets to selecting the scale user, the object has been initialised but never set, so it's using the default values, hence the userId of 0.

The behaviour is different when selecting a new user, it can set one up successfully and collect a measurement from it. It just seems to have trouble when dealing with an existing user on the scale.

TheRedWolf avatar Aug 15 '25 05:08 TheRedWolf

Thanks, I added some loggings and introduce a pendingUserId, please try out the latest beta version which also includes the previous fixes.

oliexdev avatar Aug 15 '25 05:08 oliexdev

Thanks, I added some loggings and introduce a pendingUserId, please try out the latest beta version which also includes the previous fixes.

Looks like it is able to pair properly now! I've been able to get measurements recording into the app from the scales.

When disconnecting and reconnecting, I do get prompted to select the user on scale again, but I don't get asked for the consent code again.

Not entirely sure why, but the only metrics being recorded is weight, plus the three derived values BMI, BMR and TDEE. Muscle, fat, water etc aren't being recorded. There is also still a discrepency between the scale reported values for BMR and TDEE vs what the app is calculating (similar to before, the app is reporting a BMR maybe ~100-120 or so below what the scales report)

Spotted another language one though, tapping on the filters icon (top right next to the profile) displays German day options, except for "Show/Hide Measurement Filter" which is in English.

TheRedWolf avatar Aug 15 '25 05:08 TheRedWolf

Thanks, I added some loggings and introduce a pendingUserId, please try out the latest beta version which also includes the previous fixes.

Looks like it is able to pair properly now! I've been able to get measurements recording into the app from the scales.

Great 👍

When disconnecting and reconnecting, I do get prompted to select the user on scale again, but I don't get asked for the consent code again.

I added some logging and small adjustments pleae try the latest beta build again and post the log file here.

Not entirely sure why, but the only metrics being recorded is weight, plus the three derived values BMI, BMR and TDEE. Muscle, fat, water etc aren't being recorded. There is also still a discrepency between the scale reported values for BMR and TDEE vs what the app is calculating (similar to before, the app is reporting a BMR maybe ~100-120 or so below what the scales report)

all derived values are calculcated by the app and could be different by the scale as the vendor could use different formula. Why the muscle, fat, water etc. are not recording. I need the log file to look into it.

Spotted another language one though, tapping on the filters icon (top right next to the profile) displays German day options, except for "Show/Hide Measurement Filter" which is in English.

Thanks it should be fixed.

oliexdev avatar Aug 15 '25 06:08 oliexdev

Ran another test with the latest commits and have a log, but I'm hesitant to put my personal data in the public issues list. I'll email you the log separately.

TheRedWolf avatar Aug 15 '25 06:08 TheRedWolf

Thanks, I made a small fix to the merging function, please try it out.

oliexdev avatar Aug 15 '25 07:08 oliexdev

btw "When disconnecting and reconnecting, I do get prompted to select the user on scale again, but I don't get asked for the consent code again." did it resolved?

oliexdev avatar Aug 15 '25 07:08 oliexdev

btw "When disconnecting and reconnecting, I do get prompted to select the user on scale again, but I don't get asked for the consent code again." did it resolved?

Not at this stage, I still get prompted to select a scale user every time I connect. It only prompts me for the consent code once, the first time I connect to the scale.

TheRedWolf avatar Aug 15 '25 07:08 TheRedWolf

Thanks, I made a small fix to the merging function, please try it out.

Confirmed that water, fat, muscle, lbm and bone all now get recorded

TheRedWolf avatar Aug 15 '25 07:08 TheRedWolf