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

[VER-507] fix: Correctly display Konnectors icons after closing/reopenning the extension's popup #192

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Apr 25, 2024

KonnectorsOrganization is currently saved in the account InMemory storage as an object

We found that this may produce DeadObjects errors on Firefox due to the way it manage memory

Exemple scenario for reproducing this problem: open the Cozy Connectors folder, close the extension popup and re-open it. The ciphers will lose their "shared with Cozy" icons and the can’t access dead object error should appear in the devtools

We found that storing the info in the account as a string instead of an object would prevent the issue to happen

We could have also use defaultOnDiskOptions instead of defaultInMemoryOptions to save the KonnectorsOrganization data, but the string option seems to have less possible side effects

Related link:
https://blog.mozilla.org/addons/2012/09/12/what-does-cant-access-dead-object-mean/

@Ldoppea Ldoppea marked this pull request as ready for review April 25, 2024 15:29
@Ldoppea Ldoppea changed the title fix: Correctly display Konnectors icons after closing/reopenning the extension's popup [VER-507] fix: Correctly display Konnectors icons after closing/reopenning the extension's popup Apr 25, 2024
KonnectorsOrganization is currently saved in the account InMemory
storage as an object

We found that this may produce DeadObjects errors on Firefox due to the
way it manage memory

Exemple scenario for reproducing this problem: open the Cozy Connectors
folder, close the extension popup and re-open it. The ciphers will lose
their "shared with Cozy" icons and the `can’t access dead object` error
should appear in the devtools

We found that storing the info in the account as a string instead of an
object would prevent the issue to happen

We could have also use `defaultOnDiskOptions` instead of
`defaultInMemoryOptions` to save the `KonnectorsOrganization` data, but
the string option seems to have less possible side effects

Related link:
https://blog.mozilla.org/addons/2012/09/12/what-does-cant-access-dead-object-mean/
@zatteo
Copy link

zatteo commented Apr 25, 2024

The second commit talks about backgroundColor ? Copy/paste mistake ?

CipherRowComponent is displayed with a *cdkVirtualFor loop. As stated
in the documentation, "To improve rendering performance, *cdkVirtualFor
caches previously created views after they are no longer needed. When a
new view would normally be created, a cached view is reused instead."

So we can not set the isKonnector in ngOnInit because it will keep the
value of the first elements created

Related commit: 14338fe
@Ldoppea
Copy link
Member Author

Ldoppea commented Apr 25, 2024

The second commit talks about backgroundColor ? Copy/paste mistake ?

Yes sorry, i copy pasted your commit message. Fixed.

@Ldoppea Ldoppea merged commit bd180e8 into feat/stream1 Apr 26, 2024
1 check passed
@delete-merged-branch delete-merged-branch bot deleted the fix/konnector_icon branch April 26, 2024 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants