You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@arlyxiao as I have mentioned in the previous thread: if the network is turned off before initialization, then analytics won't be able to get the settings and will fallback to use cached settings. so there are two cases:
if the app has being initialized before with network, then it already has a cached validate settings to use. you should see events written to disk with no problem.
if the app is started fresh (i.e. all app directories are cleared) and network is off, then the SDK has no idea on what the settings are. the default value is just an empty object, and every destination is turned off by this check if it is not present in settings.integrations. if you definitely want to cover this case you need provide your default settings to defaultSettings in configuration:
var configuration = new Configuration("Your write key",
defaultSettings: new Settings
{
Integrations = new JsonObject
{
["Segment.io"] = new JsonObject
{
["apiKey"] = "Your write key"
}
}
});
make sure all analytics related directories are cleared before testing it again.
however, I do not recommend of doing this, because it leads to another edge case: your settings instruct the SDK to track events but your remote settings actually turned off segment.io as an destination. then when the network comes back, you will see cached events sending to your segment dashboard.
The issue can be reopen
#121
Debug with the function RunningUpdate
https://github.com/segmentio/Analytics-CSharp/blob/main/Analytics-CSharp/Segment/Analytics/Plugins/StartupQueue.cs#L47
Here are the test steps:
state.running is true
from the function RunningUpdate, https://github.com/segmentio/Analytics-CSharp/blob/main/Analytics-CSharp/Segment/Analytics/Plugins/StartupQueue.cs#L47In conclusion, if the segment instance is initialized offline, even state.running = true, it will not generate the temporary file.
The text was updated successfully, but these errors were encountered: