Mattermost-server: OpenGraph results that change over time overwrite each other

Created on 30 Aug 2019  路  6Comments  路  Source: mattermost/mattermost-server

Prior to post metadata, we would always show the current OpenGraph preview for each link posted, but with post metadata, we store the OpenGraph preview at the time each post was made. Unfortunately, the logic in the client only stores one preview for each link, so if the same link was posted a month ago and then posted again today, both posts show the same OpenGraph preview even if the page changed since then.

Repro steps:
1) Post a link with an OpenGraph preview
2) After at least an hour has passed and the content of the linked page has changed, post the same link again in another channel
3) Refresh the web app while viewing either of those posts
4) View the other post

Observe: The first post you view will have the correct preview at first. Once you view the other post, both will have the preview from the second post.
Expected: Each post has its own OpenGraph preview depending on when it was posted, not on when you view them


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-14622

AreTechnical Debt Medium Help Wanted PR Exists TecReact Native TecReactJS TecRedux

All 6 comments

@hmhealey Can you please add the appropriate labels to this issue?

I'll pick this one up if that's OK?

Sure. Thanks for working on it @ChrisDobby :+1:

Let me know if you need any help on this one, @ChrisDobby. It might be a bit tricky due to how that part of the mattermost-redux state is set up for this since it maps each URL to a single OpenGraph object

Thanks @hmhealey I've made a change to store the opengraph data against the post id and url. Looks to be working fine in the web app, once I've tested it in the mobile app I'll create a PR.

Awesome! One thing to be aware of with the mobile app is that you might need to tweak how it loads that data into the store. The mobile app has to be backwards compatible with servers that didn't provide that metadata as part of the post, so it loads it differently than the web app on those servers. That may not affect your changes, but it's just something to be aware of if you see different logic for loading that in the mobile app

Was this page helpful?
0 / 5 - 0 ratings