deploygate-android-sdk icon indicating copy to clipboard operation
deploygate-android-sdk copied to clipboard

Some of SDK API calls should be buffered if a service connection has not been established yet

Open jmatsu opened this issue 2 years ago • 1 comments

All instructions in SDK except initialization require the active service connection, and the current implementation ignores the instructions until a service connection is established. See the following diagram.

sequenceDiagram
    participant Android
    participant UserApp
    participant SDK
    participant ClientApp
opt DirectBoot
    Android->>UserApp: Direct boot event
    UserApp->>SDK: Request establishing service connection
    SDK-->ClientApp: Failed to establish service connection
    UserApp->>SDK: Call a SDK API
    SDK-->SDK: Ignore the call cuz a service is unavailable
end
opt NormalBoot
    Android->>UserApp: Boot completed event
    UserApp->>SDK: Request establishing service connection
    SDK-->ClientApp: Failed to establish service connection
    UserApp->>SDK: Call a SDK API
    SDK-->SDK: Ignore the call cuz a service is unavailable
end

Android->>ClientApp: Boot completed
ClientApp->>SDK: Service connection is established
loop Working
    UserApp->>SDK: Call a SDK API
    SDK->>ClientApp: Publish the instruction
    ClientApp->>ClientApp: Process
end

Ignoring API calls like Custom Logging may not be helpful for users. We somehow should help such users. The order of the components that receive the event is nondeterministic, so we need buffering the API calls; This means supporting Direct Boot by DeployGate client app would not solve this issue. API calls buffering would be beneficial in many cases.

jmatsu avatar Apr 09 '22 17:04 jmatsu

We have decided to release the buffer of logs in advance.

jmatsu avatar May 10 '22 08:05 jmatsu