Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

[M273] - Fix switching between documents #98

Merged
merged 2 commits into from
Oct 24, 2024
Merged

[M273] - Fix switching between documents #98

merged 2 commits into from
Oct 24, 2024

Conversation

danielkweon
Copy link
Contributor

@danielkweon danielkweon commented Oct 23, 2024

https://linear.app/macro-eng/issue/M-273/switching-between-documents-using-expanded-doc-load-causes-a-crash

Issue and solution

  • storage instance MUST be set before storage base

  • instance and base are the same objects, just casted differently

  • instance is stored in an uno::Reference while base is stored in a shared_ptr

  • if the base is released first (as the shared_ptr is set), the uno reference has a bad time when it tries to access the instance (which is now a null object) with it's pointer

also bumping to version 0.1.8 to create a new build into app-monorepo

@danielkweon danielkweon requested review from synoet and chase October 23, 2024 22:50
@danielkweon danielkweon marked this pull request as ready for review October 23, 2024 22:50
Comment on lines +157 to +161
try {
props.doc.off(CallbackType.DOCUMENT_SIZE_CHANGED, callback);
} catch (e) {
console.log('error', e);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be actually fixed. My try/catch was just so I could test that it works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This prop doesn't exist and isn't how the app-monorepo with the blocks handles new documents. I'll add a note that this needs to be fixed, but I'm going to focus on fixing the app-monorepo first.

@danielkweon danielkweon self-assigned this Oct 23, 2024
@danielkweon danielkweon merged commit b6028d7 into main Oct 24, 2024
@danielkweon danielkweon deleted the m273 branch October 24, 2024 00:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants