Skip to content

Conversation

@noelcarcasesLYN
Copy link

Summary

Fix media upload for channels by correcting two issues in processMediaData:

  • Use mediaInfo.mimetype instead of file.type when creating opaque data, ensuring the correct MIME type is passed
  • Pass getRandomFilehash as a function reference instead of invoking it immediately with getRandomFilehash()

Changes

Utils.js:449: Fixed MIME type parameter for OpaqueData.createFromData

- const opaqueData = await window.Store.OpaqueData.createFromData(file, file.type);
+ const opaqueData = await window.Store.OpaqueData.createFromData(file, mediaInfo.mimetype);
Utils.js:503: Fixed calculateToken to pass function reference
- ...(sendToChannel ? { calculateToken: window.Store.SendChannelMessage.getRandomFilehash() } : {})
+ ...(sendToChannel ? { calculateToken: window.Store.SendChannelMessage.getRandomFilehash } : {})

Ensures correct media upload to channels by using the mimetype from mediaInfo, rather than the file, when creating OpaqueData.

Also, it replaces the call to the function getRandomFilehash with the value of the function to retrieve the correct token.
Copy link

@tlgsn tlgsn left a comment

Choose a reason for hiding this comment

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

Yes, it works well. Thank you.

Copy link

@tahafatih tahafatih left a comment

Choose a reason for hiding this comment

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

Its worked. Thank you.

@danpasecinic
Copy link

Can confirm, works like a charm!

@owen800q
Copy link

owen800q commented Jan 9, 2026

@tahafatih @tlgsn @danpasecinic Can you help merge this PR?
thanks

@danpasecinic
Copy link

@owen800q we can't merge PR without at least 2 reviews by reviewers with write access to repository.

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.

6 participants