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

Various fixes to support posts with no user #8877

Open
wants to merge 7 commits into
base: master
from

Conversation

@udan11
Copy link
Member

udan11 commented Feb 6, 2020

No description provided.

@discoursebot

This comment has been minimized.

Copy link

discoursebot commented Feb 6, 2020

You've signed the CLA, udan11. Thank you! This pull request is ready for review.

@udan11 udan11 requested a review from ZogStriP Feb 10, 2020
@udan11 udan11 marked this pull request as ready for review Feb 10, 2020

class RemoveNotNullFromUserId < ActiveRecord::Migration[6.0]
def up
execute "ALTER TABLE topic_links ALTER COLUMN user_id DROP NOT NULL"

This comment has been minimized.

Copy link
@ZogStriP

ZogStriP Feb 11, 2020

Member

Do you know when this could be happening? When are we deleting an user but forgetting to delete topic_links records?

This comment has been minimized.

Copy link
@udan11

udan11 Feb 13, 2020

Author Member

As part of the post processing pipeline we are calling TopicLink.extract_from. When processing a post with no user, that method will raise an exception as it attempts to create TopicLink records (because user_id is nil).

This comment has been minimized.

Copy link
@ZogStriP

ZogStriP Feb 13, 2020

Member

Maybe we should instead bypass the post processing altogether if there are no user associated to a post?

This comment has been minimized.

Copy link
@udan11

udan11 Feb 14, 2020

Author Member

I do not think it makes sense skipping post processing because some things may not work anymore, but I made it skip TopicLink creation which was the problem in the first place.

udan11 added 7 commits Feb 6, 2020
@udan11 udan11 force-pushed the udan11:fix_posts_without_user branch from 47a0b70 to 1fb9b2f Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.