Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

listOfflineRecordings doesn't list all recordings #491

Open
2 tasks done
metuuu opened this issue Oct 23, 2024 · 3 comments
Open
2 tasks done

listOfflineRecordings doesn't list all recordings #491

metuuu opened this issue Oct 23, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@metuuu
Copy link

metuuu commented Oct 23, 2024

Platform on which you observed the bug:

  • Android (polar-ble-sdk 5.7.0)
  • [?] iOS (not tested)

Device on which you observed the bug:

  • Polar Verity Sense (Software: 2.2.6)

Describe the bug
Listing sensor measurements might return only single item even though there are multiple recordings. After the first recording is removed from the sensor, then polar ble sdk returns the other item.
I have not find a reason for this or a way to reproduce this consistently.

I had this issue happening 2/3 of the time but in the next day it stopped and never happened for me again. After I released our app to testing, our tester had the same issue where he described that approximately every 1/3 recording is missing ACC. And after the recording is removed from sensor then the ACC appears. The recordings were approx 10min - 1h long. (When I had the issue, the recording time didn't affect the outcome. I tested 10sec - 10min recordings)

How to Reproduce

  1. Start PPI+ACC or PPG+ACC recordings with Verity Sense.
  2. Wait a moment and stop both recordings
  3. List recordings -> only one of the two or both recordings are returned
  4. If only one of the two recording was returned, delete the returned recording (If both were returned, repeat until only single one is returned)
  5. List recordings -> now the missing recording should appear

Expected behavior
All recordings should be returned when listing offline recordings

The code used in our app for listing the offline recordings

    @SuppressLint("CheckResult")
    @ReactMethod
    fun listOfflineRecordings(callback: Callback) {
        if (deviceId == null) return callback.invoke("No device connected")
        api!!.listOfflineRecordings(deviceId!!)
            .observeOn(AndroidSchedulers.mainThread())
            .doOnSubscribe { offlineRecordingEntries = mutableListOf() }
            .subscribe(
                { offlineRecordingEntries!!.add(it) },
                { error ->
                    if (error is PolarOperationNotSupported) {
                        callback.invoke(ERROR_FEATURE_NOT_SUPPORTED, deviceId)
                    } else {
                        Log.d(TAG, "list offline recording failed: " + throwableToString(error))
                        callback.invoke(throwableToString(error), deviceId)
                    }
                },
                {
                    val result = Arguments.createMap()
                    val entriesArray = Arguments.createArray()
                    offlineRecordingEntries!!.forEach { entry ->
                        val entryMap = Arguments.createMap()
                        entryMap.putString("type", entry!!.type.name.lowercase())
                        entryMap.putDouble("size", entry.size.toDouble())
                        entriesArray.pushMap(entryMap)
                    }
                    result.putArray("entries", entriesArray)
                    callback.invoke(null, result)
                }
            )
    }
@metuuu metuuu added the bug Something isn't working label Oct 23, 2024
@samulimaa
Copy link
Contributor

Hi, thanks for reporting this, we have created internal ticket to fix this on upcoming releases.

@metuuu
Copy link
Author

metuuu commented Nov 1, 2024

Thank you! Were you able to reproduce the issue?

@samulimaa
Copy link
Contributor

We are working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants