SciPhi-AI/R2R

The r2r-js client has no option to disable posthog data collection

Closed this issue · 1 comments

Describe the bug
There is no option for the developer to disable the posthog data collection.

I added a fake dns record to the /ect/hosts. It always stuck for a long time until timeout.

console.error
Error while shutting down PostHog PostHogFetchNetworkError: Network error while fetching PostHog
at retriable (/usr/local/src/web/typescript/R2R-client-demo/node_modules/posthog-core/src/index.ts:645:17)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at retriable (/usr/local/src/web/typescript/R2R-client-demo/node_modules/posthog-core/src/utils.ts:27:19)
at PostHog.fetchWithRetry (/usr/local/src/web/typescript/R2R-client-demo/node_modules/posthog-core/src/index.ts:635:12)
at PostHog._flush (/usr/local/src/web/typescript/R2R-client-demo/node_modules/posthog-core/src/index.ts:605:7) {
error: TypeError: fetch failed
at node:internal/deps/undici/undici:12344:11
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at retriable (/usr/local/src/web/typescript/R2R-client-demo/node_modules/posthog-core/src/index.ts:639:17)
at retriable (/usr/local/src/web/typescript/R2R-client-demo/node_modules/posthog-core/src/utils.ts:27:19)
at PostHog.fetchWithRetry (/usr/local/src/web/typescript/R2R-client-demo/node_modules/posthog-core/src/index.ts:635:12)
at PostHog._flush (/usr/local/src/web/typescript/R2R-client-demo/node_modules/posthog-core/src/index.ts:605:7) {
cause: Error: connect ECONNREFUSED 127.0.0.1:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1595:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 443
}
}
}

To Reproduce

Expected behavior
The Client object should have a disablePosthog option.

export declare class r2rClient {
private axiosInstance;
private baseUrl;
private accessToken;
private refreshToken;
constructor(baseURL: string, prefix?: string);

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context
Add any other context about the problem here.

Please close the issue as I put it in the wrong place.