Skip to content

Commit

Permalink
fix: use uri to make token storage key unique (codedge-llc#239)
Browse files Browse the repository at this point in the history
* fix: move token generation to agent (#1)

* fix: add uri to token storage key to prevent clashes (codedge-llc#2)

* Catch up with upstream (codedge-llc#3)

* fix: allow httpoison 2.0 (codedge-llc#236)

* fix: allow httpoison 2.0

* ci: fix workflows

* ci: revert to ubuntu-latest

* ci: use setup-beam@v1

* chore: update CHANGELOG

* docs: update README links

* fix: move token generation into Pigeon.APNS.Token (codedge-llc#227)

This means the token is only generated once and used across all workers

* chore: update CHANGELOG

---------

Co-authored-by: Henry Popp <[email protected]>
Co-authored-by: Henry Popp <[email protected]>
Co-authored-by: Andrew Timberlake <[email protected]>

* chore: run mix format on our changes (codedge-llc#4)

* fix: allow httpoison 2.0 (codedge-llc#236)

* fix: allow httpoison 2.0

* ci: fix workflows

* ci: revert to ubuntu-latest

* ci: use setup-beam@v1

* chore: update CHANGELOG

* docs: update README links

* fix: move token generation into Pigeon.APNS.Token (codedge-llc#227)

This means the token is only generated once and used across all workers

* chore: update CHANGELOG

---------

Co-authored-by: Henry Popp <[email protected]>
Co-authored-by: Henry Popp <[email protected]>
Co-authored-by: Andrew Timberlake <[email protected]>

* chore: undo random formatting changes that aren't necessary

---------

Co-authored-by: Drew Ballance <[email protected]>
Co-authored-by: Henry Popp <[email protected]>
Co-authored-by: Henry Popp <[email protected]>
Co-authored-by: Andrew Timberlake <[email protected]>
  • Loading branch information
5 people authored Nov 24, 2023
1 parent 7871ff7 commit 210c33d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/pigeon/apns/token.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ defmodule Pigeon.APNS.Token do

@spec get(JWTConfig.t()) :: t
def get(%JWTConfig{} = config) do
token_storage_key = config.key_identifier <> ":" <> config.team_id
token_storage_key =
config.key_identifier <> ":" <> config.team_id <> ":" <> config.uri

Agent.get_and_update(__MODULE__, fn map ->
{timestamp, saved_token} = Map.get(map, token_storage_key, {0, nil})
Expand Down

0 comments on commit 210c33d

Please sign in to comment.