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

[Main][Task]29884493: Add a Function to Export Offline Listener From Sender #2434

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export class SenderTests extends AITestClass {
QUnit.assert.equal('https://example.com', extConfig.endpointUrl, 'Channel config can be set from root config (endpointUrl)');
QUnit.assert.notEqual(654, extConfig.maxBatchSizeInBytes, 'Channel config does not equal root config option if extensionConfig field is also set');
QUnit.assert.equal(456, extConfig.maxBatchSizeInBytes, 'Channel config prioritizes extensionConfig over root config');

let offlinelistener = this._sender.getOfflineListener();
QUnit.assert.ok(offlinelistener, "offline listener exists")
}
});

Expand Down
14 changes: 14 additions & 0 deletions channels/applicationinsights-channel-js/src/Sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControls {
_self.isCompletelyIdle = () => {
return !_paused && _syncFetchPayload === 0 && _self._buffer.count() === 0;
}

_self.getOfflineListener = () => {
return _offlineListener;
}

/**
* xhr state changes
Expand Down Expand Up @@ -1456,4 +1460,14 @@ export class Sender extends BaseTelemetryPlugin implements IChannelControls {
return null;
}

/**
* Get Offline listener
* @returns offlineListener
* @since 3.3.4
*/
public getOfflineListener(): IOfflineListener {
// @DynamicProtoStub - DO NOT add any code as this will be removed during packaging
return null;
}

}
Loading
Loading