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

fix: don't load self convo's messages into memory [WPB-6166] #16589

Merged
merged 6 commits into from Jan 23, 2024

Conversation

PatrykBuniX
Copy link
Contributor

@PatrykBuniX PatrykBuniX commented Jan 22, 2024

SpikeWPB-6166 [Web] [4hrs] Investigate possible memory leakages due to backup restore

Description

After importing a backup we are loading all the unread messages into the conversations. It could happen that a user has a lot of events sent inside their self conversation (type 1).

Since self conversation is never appearing in the ui, there's no way for user to read a message in this conversation. We should never load messages of self conversation into the memory.

Checklist

  • PR has been self reviewed by the author;
  • Hard-to-understand areas of the code have been commented;
  • If it is a core feature, unit tests have been added;

@PatrykBuniX PatrykBuniX force-pushed the fix/importing-backup-optimisation branch from 41664dd to 16f494c Compare January 23, 2024 09:20
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (release/q1-2024@921b741). Click here to learn what that means.

Additional details and impacted files
@@                Coverage Diff                 @@
##             release/q1-2024   #16589   +/-   ##
==================================================
  Coverage                   ?   45.52%           
==================================================
  Files                      ?      743           
  Lines                      ?    24317           
  Branches                   ?     5532           
==================================================
  Hits                       ?    11071           
  Misses                     ?    11829           
  Partials                   ?     1417           

Copy link
Contributor

@atomrc atomrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid. Great catch man 👏

@PatrykBuniX PatrykBuniX merged commit 31068bc into release/q1-2024 Jan 23, 2024
10 checks passed
@PatrykBuniX PatrykBuniX deleted the fix/importing-backup-optimisation branch January 23, 2024 10:18
github-actions bot pushed a commit that referenced this pull request Jan 23, 2024
* fix: don't load self convo's messages into memory

* [tmp]

* test: update tests

* refactor: improve naming

* test: fix tests

* test: simplify generating a convo
PatrykBuniX added a commit that referenced this pull request Jan 23, 2024
…#16594)

* fix: don't load self convo's messages into memory

* [tmp]

* test: update tests

* refactor: improve naming

* test: fix tests

* test: simplify generating a convo

Co-authored-by: Patryk Górka <patrykbunix@gmail.com>
atomrc added a commit that referenced this pull request Jan 29, 2024
* runfix: add e2ei-verification type to expected events (#16554)

* runfix: exclude self mls conversation from setting verification state

* refactor: simplify if statement

* chore: unstuck ci please

* chore: Make sure entire repo is fetched when cherry-picking release commits

* feat: one2one migrated to mls system message [WPB-6195] (#16560)

* feat: add system message for 1:1 conversation migrated to mls

* test: check if message was injected

* refactor: improve naming

* refactor: add check for connection request to conversation selectors

* runfix: change type to 1:1 only in init proteus method

* runfix: always blacklist proteus 1:1 if its being migrated to mls

* refactor: improve naming

* docs: type

Co-authored-by: Thomas Belin <thomasbelin4@gmail.com>

---------

Co-authored-by: Thomas Belin <thomasbelin4@gmail.com>

* feat: update download path (#16460)

* feat: initial code for listening to feature change

* feat: catch team dl path event

* feat: small updates for type changes and passing event correctly to wrapper

* chore: updates for catching download path on restart

* feat: add modal for catching feature changes

* test: extend/fix tests

* fix: Read indicator design improvements (#16591)

* fix: Read indicator desing improvements

* add padding-left for reactions

* fix cursor

* fix: don't load self convo's messages into memory [WPB-6166] (#16589)

* fix: don't load self convo's messages into memory

* [tmp]

* test: update tests

* refactor: improve naming

* test: fix tests

* test: simplify generating a convo

* refactor: Remove oidcproxy (#16596)

* fix: when grace period is over select the enrollment type based on certificate availability (#16599)

* chore: upgrade CoreCrypto to rc31 (#16598)

* ci: set more fields and retry (#16586)

* feat: bump core with new core-crypto (#16603)

* fix: read indicator images improvements (#16605)

* fix: read indicator images improvements

* fixes

* fix image asset width

* runfix: Fix enrolling to e2ei with non-ascii user name (#16607)

* chore: Fix running CI jobs on cherry-picked commits (#16609)

* chore: Auto merge cherry picked commits to dev (#16611)

* chore: Auto merge cherry picked commits to dev

* fix naming

* fix target

* fix naming

* chore: Fix permission for flagging auto cherry picked PR

* test: gh ci test

* test: revert gh ci test

This reverts commit 757aa10.

* chore: Fix permission for cherry-pick job

* chore: fix tagging auto merge PR

* chore: use github token to auto approve PR

* chore: Auto merge PR from otto-the-bot and dependabot (#16616)

* chore: Auto merge PR from otto-the-bot and dependabot

* removeme

* fix config

* fixup

* fix: Enforce download path change if featureStatus is not changed (#16623)

* feat: show modal if feature status unchanged

* fix: test/functionality

* chore: Trigger publish job on release branches (#16624)

* chore: Fix docker images tag

no slashes are allowed in quay.io image tags

* runfix: Deregister the single instance of the app as late as possible (#16627)

* runfix: address read indicator design review (WPB-5369) (#16629)

* runfix: assign max-width to all assets

* remove read indicator from message header

* feat: group messages sent within a short timeframe (WPB-6237) (#16631)

* feat: group messages sent within a short timeframe (WPB-6237)

* use TIME_IN_MILLIS util

* chore: Make cherry-pick PR title semantically correct (#16632)

* chore: Fix renaming PR job

* chore: fix action token

* chore: fix renaming job access token

* chore: Make sure we have the repo when renaming PR

* chore: use PR urls

* runfix: position system message timestamps correctly (#16640)

* feat: Do not load all team members on app load [WPB-4553 WPB-4548] (#16160) (#16258)

* feat: Do not load all team members on app load [WPB-4553 WPB-4548 WPB-1912] (#16160)

* fix: bring back subscribing to team members changes

* fix e2eiHandler error

---------

Co-authored-by: Thomas Belin <thomasbelin4@gmail.com>

* feat(e2ei): link renew certificate action with UI button (#16643)

* feat(e2ei): link cert renewal with ui button

* chore: remove comment

* fix: tests

* runfix: make assets use all available width (#16646)

* feat: client certificate revocation list [WPB-3232] (#16649)

* feat: handle conversation state every time crl changes

* feat: show modal if self client's cert is revoked

* test: fix tests by updating mocks

* runfix: cover validating slef crl with try catch

* chore: remove node script

* chore: bump core

* runfix: bump core with rolled back core-crypto to vrc33

* feat: client certificate revocation list [WPB-3232] (#16649)

* feat: handle conversation state every time crl changes

* feat: show modal if self client's cert is revoked

* test: fix tests by updating mocks

* runfix: cover validating slef crl with try catch

* chore: remove node script

* chore: bump core

* runfix: bump core with rolled back core-crypto to vrc33

* runfix: address read indicator design review (WPB-5369) (#16629)

* runfix: assign max-width to all assets

* remove read indicator from message header

* chore: Make cherry-pick PR title semantically correct (#16632)

* chore: Fix renaming PR job

* chore: fix renaming job access token

---------

Co-authored-by: Patryk Górka <patrykbunix@gmail.com>
Co-authored-by: Timothy LeBon <tlebon@gmail.com>
Co-authored-by: Przemysław Jóźwik <przemyslaw.jozwik96@gmail.com>
Co-authored-by: Arjita <arjitamitra3@gmail.com>
Co-authored-by: Stefan Matting <smatting@users.noreply.github.com>
Co-authored-by: Virgile <78490891+V-Gira@users.noreply.github.com>
Co-authored-by: Amir Ghezelbash <thisisamir98@gmail.com>
Co-authored-by: Adrian Weiß <77456193+aweiss-dev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants