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

Session Replays: dashboard is empty #9

Open
iramzyy opened this issue Sep 30, 2024 · 7 comments
Open

Session Replays: dashboard is empty #9

iramzyy opened this issue Sep 30, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@iramzyy
Copy link

iramzyy commented Sep 30, 2024

Expected Behavior

I should see the recorded sessions on the dashboard

Current Behavior

The dashboard is empty and i'm getting this error in the Xcode consle:

Error: [StorageCoordinator] Failed to upload block file:///var/mobile/Containers/Data/Application/725D448F-E8AD-424C-AF73-416FEB9D40D5/Library/Application%20Support/com.amplitude.sessionreplay/f18ccdf553d28a4794706249bb383587/CA9152FD-6347-43BF-9976-5CB6C6F0BAAC_1727772540273_0.replay: Error Domain=NSCocoaErrorDomain Code=260 "The file “CA9152FD-6347-43BF-9976-5CB6C6F0BAAC_1727772540273_0.replay” couldn’t be opened because there is no such file." UserInfo={NSURL=file:///var/mobile/Containers/Data/Application/725D448F-E8AD-424C-AF73-416FEB9D40D5/Library/Application%20Support/com.amplitude.sessionreplay/f18ccdf553d28a4794706249bb383587/CA9152FD-6347-43BF-9976-5CB6C6F0BAAC_1727772540273_0.replay, NSFilePath=/var/mobile/Containers/Data/Application/725D448F-E8AD-424C-AF73-416FEB9D40D5/Library/Application Support/com.amplitude.sessionreplay/f18ccdf553d28a4794706249bb383587/CA9152FD-6347-43BF-9976-5CB6C6F0BAAC_1727772540273_0.replay, NSUnderlyingError=0x301610c00 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

Steps to Reproduce

My current Implementation is:

import AmplitudeSwift
import AmplitudeSwiftSessionReplayPlugin

    let amplitude = Amplitude(configuration: Configuration(apiKey: XXXX,
                                                           logLevel: .DEBUG,
                                                           autocapture: [.appLifecycles,
                                                                                           .sessions]))

   amplitude.add(plugin: AmplitudeSwiftSessionReplayPlugin(sampleRate: 1))

And i have enabled the session replay from the dashboard settings
Screenshot 2024-09-30 at 4 47 01 PM

Environment

I'm Using iOS SDK

  • AmplitudeSessionReplay 0.0.2
  • AmplitudeSwift 1.9.2
  • AmplitudeSwiftSessionReplayPlugin (0.0.2)
@iramzyy iramzyy added the bug Something isn't working label Sep 30, 2024
@iramzyy iramzyy changed the title Session Replays dashboard is empty Session Replays: dashboard is empty Sep 30, 2024
@iramzyy iramzyy closed this as completed Oct 1, 2024
@iramzyy iramzyy reopened this Oct 8, 2024
@iramzyy
Copy link
Author

iramzyy commented Oct 8, 2024

Session is recorded only if it's the first launch after i open the app for the second time i'm getting this error and sessions is not recorded

Error: [StorageCoordinator] Failed to clean up block file:///Users/ahmedramzy/Library/Developer/CoreSimulator/Devices/CFBDF940-2876-4E25-9347-41499DF3F854/data/Containers/Data/Application/FCF208A8-624E-465F-AD10-64C5CAEC1E81/Library/Application%20Support/com.amplitude.sessionreplay/f18ccdf553d28a4794706249bb383587/7DE226AB-B695-43E9-9234-187BED76195B_1728387223326_1.replay

@crleona
Copy link
Collaborator

crleona commented Oct 9, 2024

Hi @iramzyy, please update to v0.0.8 if you haven't already.

@iramzyy
Copy link
Author

iramzyy commented Oct 10, 2024

Already updated and still the same problem @crleona

@crleona
Copy link
Collaborator

crleona commented Nov 5, 2024

Hi @iramzyy, sorry for the delayed replay. We've fixed a few more setup issues in the latest version (0.0.12). If that still doesn't resolve the issue, could I ask you to share your full Amplitude setup code? (ie, are there any additional configurations around serverZone or serverURL)?

@niktishakov
Copy link

niktishakov commented Jan 21, 2025

Hello, guys. The same issue:
Error: [StorageCoordinator] Unable to retrieve info for block file:///var/mobile/Containers/Data/Application/<ID>/Library/Application%20Support/com.amplitude.sessionreplay/<api_key>/_1737433081924_7.replay, removing

Setup Code from AppDelegate.swift:

import AmplitudeSwift
import AmplitudeSwiftSessionReplayPlugin
...

let amplitude = Amplitude(configuration: Configuration(apiKey: <api_key>))
amplitude.logger = CustomAmplitudeLogger()
         
let sessionReplayPlugin = AmplitudeSwiftSessionReplayPlugin(sampleRate: 1.0, enableRemoteConfig: false)
amplitude.add(plugin: sessionReplayPlugin)

Podfile:

...
target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  pod 'AmplitudeSessionReplay', :git => 'https://github.com/amplitude/AmplitudeSessionReplay-iOS.git'
  pod 'AmplitudeSwiftSessionReplayPlugin', :git => 'https://github.com/amplitude/AmplitudeSessionReplay-iOS.git'

  target 'RunnerTests' do
    inherit! :search_paths
  end
end
...

I develop flutter iOS app and want to add this iOS-Native plugin to track session replay, but it only takes me empty 0sec records:

Image

Flutter 3.27.1, XCode 16.2, iOS 18.2, AmplitudeSessionReplay-iOS Ver. 0.1.0

@crleona
Copy link
Collaborator

crleona commented Jan 21, 2025

Hi @niktishakov, could you confirm the deviceId from the given Amplitude instance (either if you are setting it, or by querying amplitude.getDeviceId()). It looks like it may be an empty string here ("") which would cause issues.

@niktishakov
Copy link

niktishakov commented Jan 26, 2025

Hi @crleona , I'm not sure in that, because later in AppDelegate I'm setting deviceId by Flutter's method channel (fyi, I also use amplitude_flutter dependency on Flutter's side):

let sessionReplayChannel = FlutterMethodChannel(name: "session_replay", binaryMessenger: controller.binaryMessenger)
        sessionReplayChannel.setMethodCallHandler({
            (call: FlutterMethodCall, result: @escaping FlutterResult) -> Void in
            if call.method == "init" {
                // Initialize the standalone session replay SDK
                print("[Amplitude] Initializing Amplitude")
                if let arguments = call.arguments as? [String: Any],
                   let deviceId = arguments["deviceId"] as? String,
                   let sessionId = arguments["sessionId"] as? Int64 {
                    
                    print("Device ID: \(deviceId)")
                    print("Session ID: \(sessionId)")
                    
                    amplitude.setDeviceId(deviceId: deviceId)

                    result(nil)
                } else {
                    result(FlutterError(code: "INVALID_ARGUMENTS", 
                                      message: "Missing or invalid deviceId/sessionId", 
                                      details: nil))
                }
            } else if call.method == "stopRecording" {
                print("[Amplitude] Removing Session Replay Plugin")

                print("[Amplitude] Session Replay Plugin removed")
                result(nil)
            }
        })

Here is non-empty deviceId that I successfully use with amplitude.setDeviceId.

In addition I can say, that every session in amplitude dashboard has non-empty deviceId in user props as shown on screenshot below:

Image

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