Skip to content

Commit

Permalink
Update endpoint to Clearlog
Browse files Browse the repository at this point in the history
  • Loading branch information
zwu52 committed Sep 25, 2024
1 parent beaa4df commit 38c3658
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
7 changes: 2 additions & 5 deletions packages/messaging/src/helpers/logToFirelog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ import { MessagingService } from '../messaging-service';
import { Stub } from '../testing/sinon-types';
import { getFakeMessagingService } from '../testing/fakes/messaging-service';

const FIRELOG_ENDPOINT = LogModule._mergeStrings(
'hts/frbslgigp.ogepscmv/ieo/eaylg',
'tp:/ieaeogn-agolai.o/1frlglgc/o'
);
const LOG_ENDPOINT = "https://play.google.com/log?format=json_proto3";

const FCM_TRANSPORT_KEY = LogModule._mergeStrings(
'AzSCbw63g1R0nCw85jG8',
Expand Down Expand Up @@ -68,7 +65,7 @@ describe('logToFirelog', () => {

// assert
expect(fetchStub).to.be.calledOnceWith(
FIRELOG_ENDPOINT.concat('?key=', FCM_TRANSPORT_KEY),
LOG_ENDPOINT.concat('&key=', FCM_TRANSPORT_KEY),
{
method: 'POST',
body: JSON.stringify(LogModule._createLogRequest([getFakeLogEvent()]))
Expand Down
11 changes: 5 additions & 6 deletions packages/messaging/src/helpers/logToFirelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ import {
import { MessagePayloadInternal } from '../interfaces/internal-message-payload';
import { MessagingService } from '../messaging-service';

const FIRELOG_ENDPOINT = _mergeStrings(
'hts/frbslgigp.ogepscmv/ieo/eaylg',
'tp:/ieaeogn-agolai.o/1frlglgc/o'
);
const LOG_ENDPOINT = "https://play.google.com/log?format=json_proto3";

const FCM_TRANSPORT_KEY = _mergeStrings(
'AzSCbw63g1R0nCw85jG8',
Expand Down Expand Up @@ -97,7 +94,7 @@ export async function _dispatchLogEvents(
do {
try {
response = await fetch(
FIRELOG_ENDPOINT.concat('?key=', FCM_TRANSPORT_KEY),
LOG_ENDPOINT.concat('&key=', FCM_TRANSPORT_KEY),
{
method: 'POST',
body: JSON.stringify(logRequest)
Expand Down Expand Up @@ -216,7 +213,9 @@ function createAndEnqueueLogEvent(

/* eslint-disable camelcase */
logEvent.event_time_ms = Math.floor(Date.now()).toString();
logEvent.source_extension_json_proto3 = JSON.stringify(fcmEvent);
logEvent.source_extension_json_proto3 = JSON.stringify({
messaging_client_event: fcmEvent
});

if (!!productId) {
logEvent.compliance_data = buildComplianceData(productId);
Expand Down

0 comments on commit 38c3658

Please sign in to comment.