FIX: Improve bookmark modal on mobile and bookmark sync rake task (#9221)

* Improve the bookmark mobile on modal so it doesn't go all the way to the edge and the custom datetime input is easier to use
* Improve the rake task for syncing so it does not error for topics that no longer exist and batches 2000 inserts at a time, clearing the array each time
This commit is contained in:
Martin Brennan
2020-03-17 15:15:22 +10:00
committed by GitHub
parent e50abe1317
commit 16799da580
4 changed files with 54 additions and 14 deletions

View File

@ -43,6 +43,17 @@ RSpec.describe "bookmarks tasks" do
expect(Bookmark.all.count).to eq(1)
end
it "skips post actions where the post topic no longer exists and does not error" do
post1.topic.delete
post1.reload
expect { invoke_task }.not_to raise_error
end
it "skips post actions where the post no longer exists and does not error" do
post1.delete
expect { invoke_task }.not_to raise_error
end
def create_post_actions_and_existing_bookmarks
Fabricate(:post_action, user: user1, post: post1, post_action_type_id: PostActionType.types[:bookmark])
Fabricate(:post_action, user: user2, post: post2, post_action_type_id: PostActionType.types[:bookmark])