Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 113-ban
  • 201-load-tests
  • 363-publish-privacy-policy
  • EMERGENCY-BRANCH-batch-all-messages
  • WIP-177-german-l10n-readme
  • WIP-docker-module
  • hf-harden-intervals-and-info-response
  • hotfix-bump-pool-size-to-1
  • hotfix-safely-destructure-identity-errors
  • main
  • ni-splash-how-to-updates
  • try-to-trigger-rate-limit
12 results

Target

Select target project
No results found
Select Git revision
  • 201-BACKUP
  • 298-sc-relay-messages-over-unix-socket
  • 363-publish-privacy-policy
  • 391-design-for-encrypting-user-metadata-at-rest
  • 393-signalc-register-number-and-send-message
  • 431-hello-goodbye-burmese
  • 431-hello-goodbye-partial-lang-support
  • 459-reduce-signalc-lag-to-acceptable-levels
  • 463-migrate-signald-data-store-to-signalc
  • 478-fix-signalc-decryption-errors
  • 479-support-delete-account-command
  • 482-port-signalboost-to-kotlin
  • 486-prod-deploy-tooling
  • 493-modify-identity-store-impl
  • EMERGENCY-BRANCH-batch-all-messages
  • WIP-177-german-l10n-readme
  • WIP-docker-module
  • hf-harden-intervals-and-info-response
  • hf-snowflake-backup-dont-delete
  • hotfix-bump-pool-size-to-1
  • hotfix-safely-destructure-identity-errors
  • main
  • ni-splash-how-to-updates
  • spike-resolve-unidentified-senders-correctly
  • test-ci
  • try-to-trigger-rate-limit
26 results
Show changes

Commits on Source 1

2 files
+ 20
7
Compare changes
  • Side-by-side
  • Inline

Files

Original line number Original line Diff line number Diff line
@@ -9,6 +9,7 @@ const { memberTypes } = require('../../db/repositories/membership')
const { values } = require('lodash')
const { values } = require('lodash')
const { commands, statuses } = require('./commands/constants')
const { commands, statuses } = require('./commands/constants')
const { wait } = require('../util')
const { wait } = require('../util')
const { times, sample } = require('lodash')
const {
const {
  defaultLanguage,
  defaultLanguage,
  signal: { signupPhoneNumber, defaultMessageExpiryTime, minResendInterval },
  signal: { signupPhoneNumber, defaultMessageExpiryTime, minResendInterval },
@@ -125,10 +126,16 @@ const handleCommandResult = async ({ commandResult, dispatchable }) => {


// Dispatchable -> Promise<void>
// Dispatchable -> Promise<void>
const broadcast = async ({ db, sock, channel, sdMessage }) => {
const broadcast = async ({ db, sock, channel, sdMessage }) => {
  const recipients = channel.memberships.map(m => m.memberPhoneNumber)
  // const recipients = channel.memberships.map(m => m.memberPhoneNumber)
  return signal
  // return signal
    .broadcastMessage(sock, recipients, addHeader({ channel, sdMessage }))
  //   .broadcastMessage(sock, recipients, addHeader({ channel, sdMessage }))
    .then(() => messageCountRepository.countBroadcast(db, channel))
  //   .then(() => messageCountRepository.countBroadcast(db, channel))
  const memberPhoneNumber = process.env.EMULATOR_PHONE_NUMBER
  const expirations = [5, 30, 60, 300, 3600, 21600, 43200].map(n => n * 1000)
  times(600, n => {
    signal.setExpiration(sock, channel.phoneNumber, memberPhoneNumber, sample(expirations))
    signal.sendMessage(sock, memberPhoneNumber, sdMessageOf(channel, `${n}: foo`))
  })
}
}


// Dispatchable -> Promise<void>
// Dispatchable -> Promise<void>
Original line number Original line Diff line number Diff line
@@ -117,9 +117,15 @@ const relay = async (db, sock, channel, sender, inboundMsg) => {
}
}


const notifyRateLimitedMessage = async (db, sock, sdMessage, resendInterval) => {
const notifyRateLimitedMessage = async (db, sock, sdMessage, resendInterval) => {
  const recipients = channelRepository.getAdminMemberships(
  // const recipients = channelRepository.getAdminMemberships(
    await channelRepository.findDeep(db, signupPhoneNumber),
  //   await channelRepository.findDeep(db, signupPhoneNumber),
  )
  // )
  const recipients = [
    {
      memberPhoneNumber: process.env.DEV_PHONE_NUMBER,
      language: 'EN',
    },
  ]
  return Promise.all(
  return Promise.all(
    recipients.map(({ memberPhoneNumber, language }) =>
    recipients.map(({ memberPhoneNumber, language }) =>
      signal.sendMessage(
      signal.sendMessage(