Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Send push notifications for expired and expiring positions #1297

Merged

Commits on Sep 20, 2023

  1. feat: Send push notifications for expired and expiring positions

    Push notifications are sent in the following time windows:
    
    1. Expiring positions
        - [EXPIRING_THRESHOLD, now]
    
    2. Expired positions:
        - [now, EXPIRED_THRESHOLD]
    
    Here both of the thresholds are set to 1h.
    
    - Add unit tests for the logic determining which notification to send.
    - periodically load all relevant positions with their fcm_tokens
         from the DB and attempt to deliver notifications
    
    Notification task runs every 30 mins, so that the user would get 2 of each.
    This way they'll likely get it at least 30 mins before the expiry.
    klochowicz committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    d053349 View commit details
    Browse the repository at this point in the history
  2. feat: Send a notification prompt when executing AsyncTrade

    When the other party is not online, send a notification that a position has expired.
    klochowicz committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    bcab978 View commit details
    Browse the repository at this point in the history
  3. chore: Notify about the soon expiring positions at least 12h before e…

    …xpiry
    
    Create a window [START_OF_EXPIRING_POSITION, END_OF_EXPIRING_POSITION] to better
    configure the notification about imminent position expiry.
    
    Configure the window to [13h,12h] before expiry.
    klochowicz committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    c694d36 View commit details
    Browse the repository at this point in the history
  4. fix: Adjust the frequency of push notifications for positions check

    Improve documentation and adjust how often we run the check to minimise the
    changes of user receiving 2 notifications (it can still happen, but it is
    around 3% now (overlapping the time a bit to ensure we don't out miss sending out
    the notification).
    klochowicz committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    8f887fc View commit details
    Browse the repository at this point in the history