Page MenuHomePhabricator

[keyserver] Replace deprecated sendToDevice firebase-admin method
ClosedPublic

Authored by ashoat on Sep 17 2024, 12:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 7:03 AM
Unknown Object (File)
Wed, Nov 20, 7:03 AM
Unknown Object (File)
Wed, Nov 20, 7:03 AM
Unknown Object (File)
Wed, Nov 20, 6:39 AM
Unknown Object (File)
Oct 20 2024, 2:58 PM
Unknown Object (File)
Oct 20 2024, 2:58 PM
Unknown Object (File)
Oct 20 2024, 2:57 PM
Unknown Object (File)
Oct 20 2024, 2:56 PM
Subscribers

Details

Summary

This method is deprecated and is now completely failing all requests. This diff resolves ENG-235.

Test Plan

I set up a test environment on my personal server. It's running the latest keyserver release (115). In this environment, I created a test script to generate some notifs by sending messages from commbot to a test account. I confirmed that the test account received a notif on an Android device it's logged into.

I also did some testing to make sure the error handling logic worked correctly. In my test environment, I set the device token to fake and checked what the error response looked like, and made sure that error.errorInfo.code contained the error code. For my fake device token, the error code ended up being messaging/invalid-argument, but I'm pretty sure that the error code would appear in the same place for the types of errors we care about (fcmTokenInvalidationErrors).

Diff Detail

Repository
rCOMM Comm
Branch
ashoat/android
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ashoat published this revision for review.Sep 17 2024, 1:02 PM

Will wait on CI before landing

keyserver/flow-typed/npm/firebase-admin_vx.x.x.js
25

Normally I don't love having Object in types... it's basically any. However, in this case I want to resolve this urgent issue ASAP, and the type here is rather complicated. Even if we only included the subset of types we actually use, it would take a while to get all of it.

I created a follow-up task to track this work: ENG-9327

Guessing there’s some tunnelbroker follow up work too?

This revision is now accepted and ready to land.Sep 17 2024, 1:06 PM

Guessing there’s some tunnelbroker follow up work too?

Don't think Tunnelbroker was using this deprecated API. cc @marcin, @kamil to confirm