Commit Graph

35 Commits

Author SHA1 Message Date
richΛrd 5212f337d7
feat_: rate limit message publishing (#5523) 2024-08-01 14:36:25 -04:00
Andrea Maria Piana 3cc4767638
Check for mobile data connection if setting is on (#5511)
* feat_: Check for mobile data connection if setting is on

* fix_: check code control flag inside  asyncRequestAllHistoricMessages

---------

Co-authored-by: Igor Sirotin <sirotin@status.im>
2024-07-26 22:34:57 +01:00
Andrea Maria Piana d69b3e5cc9 chore_: limit max number of ephemeral keys to 3
This commit limits the number of ephemeral keys used by the push
notification client to 3, as it was noticed that it would greatly
increase the number of filters installed and was unbound.
2024-07-04 15:23:25 +01:00
Patryk Osmaczko f7042e4b9e refactor: extract layers in StatusMessage
Extracted:
- TransportLayer
- EncryptionLayer
- ApplicationLayer
2023-11-08 21:46:22 +01:00
Andrea Maria Piana 8dd1b66d69 Always use protobufs by reference & generate handlers 2023-08-22 12:08:54 +01:00
Patryk Osmaczko 5bb787fadb chore: rename RawMessage.SkipEncryption->SkipProtocolLayer
`SkipEncryption` was misleading, as it wasn't really always related with
encryption.
2023-07-07 10:30:50 +02:00
Ibrahem Khalil d3e650d5e5
Make chat muting only works on one chat and not to completely block PNs from a user (#3647) 2023-06-22 08:06:32 +03:00
Andrea Maria Piana 897bd0f58f Dont send notification to our own devices 2022-07-18 17:17:20 +01:00
Andrea Maria Piana 2d13fa1e25 Add logging of message-id 2021-11-01 11:53:08 +00:00
Andrea Maria Piana 4e33e46795 Fix race condition with PNs
Sometimes the message scheduled & message sent notifications are
received out of order.
Now we use a single channel for both so order is maintained.
This was causing the tests to be flaky and it might have happened in
production as well.
2021-10-07 12:47:40 +01:00
Andrea Maria Piana 5c55ab5264 Make sure request is originating from us before marking it as processed
This commit fixes one source of flakyness in the tests, which was an
actual bug.

If 1 device is registering with a push notification server, if there's
another device with the same public key, both would mark themselves as
registered, while maybe only one has been actually registered.

To fix this, we keep track of the request ids we send (in memory for
now), and only mark it as registered if the request was originating on
this device.
2021-09-28 12:31:26 +01:00
Volodymyr Kozieiev 0e538c0a95
Rename MessageProcessor to MessageSender (#2264) 2021-06-23 17:13:48 +03:00
Andrea Maria Piana c55659b4f6
Add community notifications (#2160)
This commit introduces the following changes:

- `local-notifications` require as body an interface complying with
`json.Marshaler`
- removed unmarshaling of `Notifications` as not used (we only Marshal
notifications)
- `protocol/messenger.go` creates directly a `Notification` instead of
having an intermediate format
- add community notifications on request to join
- move parsing of text in status-go for notifications
2021-03-31 18:23:45 +02:00
Volodymyr Kozieiev c38439e664
Listen for delivered messages (#2150) 2021-02-23 17:47:45 +02:00
Andrea Maria Piana fb6411af24
Use personal topic for push notification registration
One of the issues we noticed is that the partitioned topic
in push notification is heavy in traffic, as any user using a particular
mailserver will use that partitioned topic to register for PNs.

This commit moves from the partitioned topic to the personal topic of
the PN server, so it does not clash with other users that might happen
to have the same partitioned topic as the mailserver, resulting in long
sync times.

Another issue that will need to be addressed separately is that once you
send a message to a topic, because of the way how waku/whisper works,
you will have to register to that topic, meaning that you will receive
that data. Currently waku does not support unsubscribing from a topic
without logging in and out, so that needs also to be addressed.
2021-01-26 09:39:53 +01:00
Andrea Maria Piana cd21f9b0e2 Fix retry count in push notifications
In some instances the retry mechanism would get into a busy loop.
That's due to the fact that we would fetch some non-retriable
notifications but not act on them.

This commit fixes the issue by filtering them from the database query
and making sure that we at least wait 1 second.
2021-01-11 09:01:26 +01:00
Andrea Maria Piana 0c79e50ca8 Remove unnecessary logs & fix flaky test 2020-11-26 16:25:52 +01:00
Andrea Maria Piana b11399ffc6 Use ErrRecordNotFound instead of sql.ErrNoRows
We were checking for the wrong error kind when pulling messages from the
database, which resulted in the code not retrying to pull the message,
giving flaky tests / race condition (that's present in production as
well)
2020-10-08 13:23:00 +02:00
Andrea Maria Piana 3c6b741f71
Add tests for send notification & review feedback 2020-09-09 21:22:34 +02:00
Andrea Maria Piana 2d525f9503
Set block mentions 2020-09-09 21:22:17 +02:00
Andrea Maria Piana 8ee3c75510
Support for basic push notification for mentions 2020-09-09 21:22:13 +02:00
Andrea Maria Piana 00c5b60d7f
Move message to common namespace 2020-09-09 21:22:12 +02:00
Andrea Maria Piana 4a87764cca
seed mrand 2020-09-01 10:31:12 +02:00
Andrea Maria Piana 2ef1aa89f4
Handle connection change
Currently messenger has no notion of being online.
This might cause a problem as we retry to register with a push
notification server even if not connected to any peer, which will
inevitably fail.
This commit adds a method `handleConnectionChange` that will be called
every time the connection change state.
2020-08-27 18:54:31 +02:00
Andrea Maria Piana d7222c89e0
shuffle servers and limit & filter by chat id 2020-08-27 18:54:28 +02:00
Andrea Maria Piana 401d18e558
Enabled push notifications by default and add fleet 2020-08-27 18:54:06 +02:00
Andrea Maria Piana ac6aff2486
Re-issue bundle on changed parameters 2020-08-19 11:57:39 +02:00
Andrea Maria Piana 4cf491ae38
add push notification type 2020-08-18 16:29:58 +02:00
Andrea Maria Piana 874d1d0fa6
Update protocol/pushnotificationclient/client.go
Co-authored-by: Samuel Hawksby-Robinson <samuel@samyoul.com>
2020-08-18 16:29:57 +02:00
Andrea Maria Piana 5544e710ab
send push notification info with contact code 2020-08-18 16:29:38 +02:00
Andrea Maria Piana 4b9d3df5ad
Set RemotePushNotifications 2020-08-18 16:29:32 +02:00
Andrea Maria Piana 91074ac95e
Add apn-topic & token-type set by the client 2020-08-18 16:29:31 +02:00
Andrea Maria Piana 60e61caad8
invalidate token if allow from contacts only has been enabled 2020-08-18 16:29:30 +02:00
Andrea Maria Piana 0fb5ed2207 dont use a pointer for public methods 2020-07-29 12:51:48 +02:00
Andrea Maria Piana 4b8739a8bc
Polish up and address review feedback 2020-07-27 08:51:28 +02:00