Skip to content

The validRegistrationTokens() function does not return invalid tokens, it sets everything to valid or unknown #983

Open
@aronmedeiros

Description

@aronmedeiros

Describe the bug

When using the validRegistrationTokens() function, all tokens go to valid or unknown, the same tokens that were canceled or sent notification.

When sending a notification via the send() function, I get "Requested entity not found" on tokens that I know were canceled but still returned valid in validRegistrationTokens().

PHP 8.3
kreait/firebase-php ^7.0 (7.16.1)

Note: Sorry for my bad English.

Installed packages

beste/clock                   3.0.0  A collection of Clock implementations
beste/in-memory-cache         1.3.1  A PSR-6 In-Memory cache that can be used as a fallback implementat...
beste/json                    1.5.1  A simple JSON helper to decode and encode JSON
brick/math                    0.12.1 Arbitrary-precision arithmetic library
fig/http-message-util         1.1.5  Utility classes and constants for use with PSR-7 (psr/http-message)
firebase/php-jwt              6.11.0 A simple library to encode and decode JSON Web Tokens (JWT) in PHP...
google/auth                   1.45.1 Google Auth Library for PHP
google/cloud-core             1.61.0 Google Cloud PHP shared dependency, providing functionality useful...
google/cloud-storage          1.46.0 Cloud Storage Client for PHP
google/common-protos          4.9.0  Google API Common Protos for PHP
google/gax                    1.36.0 Google API Core for PHP
google/grpc-gcp               0.4.0  gRPC GCP library for channel management
google/longrunning            0.4.7  Google LongRunning Client for PHP
google/protobuf               4.29.3 proto library for PHP
grpc/grpc                     1.57.0 gRPC library for PHP
guzzlehttp/guzzle             7.9.2  Guzzle is a PHP HTTP client library
guzzlehttp/promises           2.0.4  Guzzle promises library
guzzlehttp/psr7               2.7.0  PSR-7 message implementation that also provides common utility met...
kreait/firebase-php           7.16.1 Firebase Admin SDK
kreait/firebase-tokens        5.2.1  A library to work with Firebase tokens
lcobucci/jwt                  5.4.2  A simple library to work with JSON Web Token and JSON Web Signature
monolog/monolog               3.8.1  Sends your logs to files, sockets, inboxes, databases and various ...
mtdowling/jmespath.php        2.8.0  Declaratively specify how to extract elements from a JSON document
predis/predis                 2.3.0  A flexible and feature-complete Redis client for PHP.
psr/cache                     3.0.0  Common interface for caching libraries
psr/clock                     1.0.0  Common interface for reading the clock.
psr/http-client               1.0.3  Common interface for HTTP clients
psr/http-factory              1.1.0  PSR-17: Common interfaces for PSR-7 HTTP message factories
psr/http-message              2.0    Common interface for HTTP messages
psr/log                       3.0.2  Common interface for logging libraries
ralouphie/getallheaders       3.0.3  A polyfill for getallheaders.
ramsey/collection             2.0.0  A PHP library for representing and manipulating collections.
ramsey/uuid                   4.7.6  A PHP library for generating and working with universally unique i...
rize/uri-template             0.4.0  PHP URI Template (RFC 6570) supports both expansion & extraction
symfony/deprecation-contracts 3.5.1  A generic function and convention to trigger deprecation notices
symfony/polyfill-mbstring     1.31.0 Symfony polyfill for the Mbstring extension

PHP version and extensions

composer                2.8.4     Composer package
composer-plugin-api     2.6.0     The Composer Plugin API
composer-runtime-api    2.2.2     The Composer Runtime API
ext-bz2                 8.3.6     The bz2 PHP extension
ext-calendar            8.3.6     The calendar PHP extension
ext-ctype               8.3.6     The ctype PHP extension
ext-curl                8.3.6     The curl PHP extension
ext-date                8.3.6     The date PHP extension
ext-dom                 20031129  The dom PHP extension
ext-exif                8.3.6     The exif PHP extension
ext-ffi                 8.3.6     The FFI PHP extension
ext-fileinfo            8.3.6     The fileinfo PHP extension
ext-filter              8.3.6     The filter PHP extension
ext-ftp                 8.3.6     The ftp PHP extension
ext-gd                  8.3.6     The gd PHP extension
ext-gettext             8.3.6     The gettext PHP extension
ext-hash                8.3.6     The hash PHP extension
ext-iconv               8.3.6     The iconv PHP extension
ext-igbinary            3.2.13    The igbinary PHP extension
ext-imagick             3.7.0     The imagick PHP extension
ext-json                8.3.6     The json PHP extension
ext-libxml              8.3.6     The libxml PHP extension
ext-mbstring            8.3.6     The mbstring PHP extension
ext-mcrypt              1.0.5     The mcrypt PHP extension
ext-mysqli              8.3.6     The mysqli PHP extension
ext-mysqlnd             0         The mysqlnd PHP extension (actual version: mysqlnd 8.3.6)
ext-openssl             8.3.6     The openssl PHP extension
ext-pcntl               8.3.6     The pcntl PHP extension
ext-pcre                8.3.6     The pcre PHP extension
ext-pdo                 8.3.6     The PDO PHP extension
ext-pdo_mysql           8.3.6     The pdo_mysql PHP extension
ext-phar                8.3.6     The Phar PHP extension
ext-posix               8.3.6     The posix PHP extension
ext-random              8.3.6     The random PHP extension
ext-readline            8.3.6     The readline PHP extension
ext-redis               5.3.7     The redis PHP extension
ext-reflection          8.3.6     The Reflection PHP extension
ext-session             8.3.6     The session PHP extension
ext-shmop               8.3.6     The shmop PHP extension
ext-simplexml           8.3.6     The SimpleXML PHP extension
ext-sockets             8.3.6     The sockets PHP extension
ext-sodium              8.3.6     The sodium PHP extension
ext-spl                 8.3.6     The SPL PHP extension
ext-sysvmsg             8.3.6     The sysvmsg PHP extension
ext-sysvsem             8.3.6     The sysvsem PHP extension
ext-sysvshm             8.3.6     The sysvshm PHP extension
ext-tokenizer           8.3.6     The tokenizer PHP extension
ext-xml                 8.3.6     The xml PHP extension
ext-xmlreader           8.3.6     The xmlreader PHP extension
ext-xmlwriter           8.3.6     The xmlwriter PHP extension
ext-xsl                 8.3.6     The xsl PHP extension
ext-zend-opcache        8.3.6     The Zend OPcache PHP extension
ext-zip                 1.22.3    The zip PHP extension
ext-zlib                8.3.6     The zlib PHP extension
lib-bz2                 1.0.8     The bz2 library
lib-curl                8.5.0     The curl library
lib-curl-libssh         0.10.6    curl libssh version
lib-curl-openssl        3.0.13    curl OpenSSL version (3.0.13)
lib-curl-zlib           1.3       curl zlib version
lib-date-timelib        2022.10   date timelib version
lib-date-zoneinfo       0         zoneinfo ("Olson") database for date
lib-fileinfo-libmagic   543       fileinfo libmagic version
lib-gd                  2.3.3     The gd library
lib-iconv               2.39      The iconv library
lib-imagick-imagemagick 6.9.12.98 The imagick-imagemagick library
lib-libsodium           1.0.18    The libsodium library
lib-libxml              2.9.14    libxml library version
lib-libxslt             1.1.39    The libxslt library
lib-libxslt-libxml      2.9.14    libxml version libxslt is compiled against
lib-mbstring-libmbfl    1.3.2     mbstring libmbfl version
lib-mbstring-oniguruma  6.9.9     mbstring oniguruma version
lib-openssl             3.0.13    OpenSSL 3.0.13 30 Jan 2024
lib-pcre                10.42     The pcre library
lib-pcre-unicode        14.0.0    PCRE Unicode version support
lib-zip-libzip          1.7.3     The zip-libzip library
lib-zlib                1.3       The zlib library
php                     8.3.6     The PHP interpreter
php-64bit               8.3.6     The PHP interpreter, 64bit
php-ipv6                8.3.6     The PHP interpreter, with IPv6 support

Steps to reproduce the issue.

  • Register a token,
  • Deregister the token,
  • Validate the token,
  • Send the push;

Error message/Stack trace

{\"error\":\"Requested entity was not found.\",\"token\":\"TOKEN\",\"validate\":{\"valid\":[\"TOKEN\"],\"unknown\":[],\"invalid\":[]}}"

Additional information

No response

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