Skip to content

Migrating from old SDK: No events received #129

Closed
@remcoros

Description

@remcoros

Describe the bug

We are migrating from the old SDK to the new one, but run into an issue where no events are received anymore.

I followed the migration guide and created a unit test to see if events are coming into the source, but (using the Debugger view on the source in Segment dashboard), no events are received.

To Reproduce

New code:

    [Fact]
    public async Task Can_track2()
    {
        var configuration = new Segment.Analytics.Configuration(
            writeKey: "xxxxx",
            flushAt: 1,
            flushInterval: 1,
            storageProvider: new InMemoryStorageProvider(),
            useSynchronizeDispatcher: true
        );

        var analytics = new Segment.Analytics.Analytics(configuration);

        analytics.Identify("user");
        analytics.Track("TestEvent");
        
        analytics.Flush();

        await Task.Delay(15000);
    }

Old code:

    [Fact]
    public async Task Can_track()
    {
        Segment.Analytics.Initialize("xxxxxx", new Config());

        Segment.Analytics.Client.Track("user", "TestEvent");

        await Segment.Analytics.Client.FlushAsync();
        Segment.Analytics.Dispose();
    }

Expected behavior

I see these events in the debugger view of the source, but it doesn't.

The 'old code' works, but using the new SDK, nothing happens.

Platform (please complete the following information):

  • Library Version in use: 2.5.1
  • Platform being tested: .NET 9 on Windows

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions