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

CB-4222 feat: read blob data for value panel #2422

Merged
merged 11 commits into from
Mar 19, 2024

Conversation

Wroud
Copy link
Member

@Wroud Wroud commented Feb 28, 2024

No description provided.

@Wroud Wroud requested a review from devnaumov February 28, 2024 10:02
@Wroud Wroud self-assigned this Feb 28, 2024
@Wroud Wroud requested a review from sergeyteleshev February 28, 2024 10:02
if (isResultSetBlobValue(this.cellValue)) {
// uploaded file preview
return URL.createObjectURL(this.cellValue.blob);
return this.cellValue.blob;
}

if (this.staticSrc) {
Copy link
Contributor

Choose a reason for hiding this comment

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

probably we want this condition to be at the end of the function
so if we have some blobs cached we return it first
and only then if there are nothing to give from cache we can give a link to download

Copy link
Member Author

Choose a reason for hiding this comment

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

priority is:

  1. changed value (preview)
  2. available src data (we don't need to have cache in this case)
  3. available cache if src is not available

() => ({
observedValueMetadata: new Map(),

observedValue<TArgs, TValue>(key: string, args: () => TArgs, loader: (args: TArgs) => Promise<TValue>): () => TValue {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can consider the key argument to be a symbol, not a string. to avoid collisions when the same key can has 2 different values depending on context where it was called

Copy link
Member Author

Choose a reason for hiding this comment

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

there is no difference because the main problem is that the same component can be mounted more than 1 time and will use the same key (no matter the type)

@Wroud Wroud merged commit eea26a5 into devel Mar 19, 2024
2 of 3 checks passed
@Wroud Wroud deleted the feat/cb-4222/suspended-blob-parsing branch March 19, 2024 07:39
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.

4 participants