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

Don't show a post's channel twice under the post in the popular view #358

Closed
Powersource opened this issue Mar 25, 2020 · 1 comment · Fixed by #366
Closed

Don't show a post's channel twice under the post in the popular view #358

Powersource opened this issue Mar 25, 2020 · 1 comment · Fixed by #366
Labels
bug Something isn't working
Milestone

Comments

@Powersource
Copy link
Collaborator

What's the problem you want solved?

Posts posted in a channel (and not just with the channel mentioned) get that channel rendered twice in at least the popular view, like this

image

(in some cases people both post in a channel, and tag the channel at the end of the post, but in that case it would look like it's rendered 3 times!)

Is there a solution you'd like to recommend?

I'm guessing it's a bug, so fix it :P Note, this is unrelated to #290

@christianbundy christianbundy added the bug Something isn't working label Mar 25, 2020
@christianbundy
Copy link
Member

Yep, it looks to me like transform() is getting called twice on one message, but an initial skim of the code didn't make it obvious why this is happening.

christianbundy added a commit to christianbundy/oasis that referenced this issue Mar 27, 2020
Problem: Messages are being fetched with `post.get()`, which runs the
`transform()` function to decorate them with Markdown/etc, but then
they're being passed through `transform()` a second time at the end of
the function. This is inefficient and applies side-effects (like adding
channels to the post) twice.

Solution: Remove the final `transform()` so that these posts are only
decorated once.

Fixes: fraction#358
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants