Skip to content

Conversation

@curquiza
Copy link
Member

  • Update meilisearch-ruby to v0.18.0
  • Remove get_or_create_index method usage
  • Changes regarding task API changes

@curquiza curquiza requested a review from brunoocasali January 12, 2022 18:27
@curquiza curquiza added the breaking-change The related changes are breaking for the users label Jan 12, 2022
@curquiza
Copy link
Member Author

This PR is breaking because uses meilisearch-ruby v0.18.0 that only works with MeiliSearch v0.25.0 and later -> it enforces the users to upgrade their MeiliSearch version

@curquiza curquiza force-pushed the v0.25.0-changes branch 3 times, most recently from 80fffc3 to c024e75 Compare January 12, 2022 18:42
before_save_statuses = People.index.get_all_update_status
before_save_status = before_save_statuses.last
before_save_statuses = People.index.tasks['results']
before_save_status = before_save_statuses.first
Copy link
Member Author

Choose a reason for hiding this comment

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

Now, the most recent tasks are at the top of the list. In meilisearch v0.24.0 they were at the end of the list.

Copy link
Member

Choose a reason for hiding this comment

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

What do you think about using the find method in this array in order to keep this working even when the order changes?

before_save_status = before_save_statuses.find {|t| t['...'] = ... }

And also for the line below...

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure to get exactly what you want. Can you suggest changes? :)

Copy link
Member

Choose a reason for hiding this comment

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

I tried to use a expect/receive but I didn’t know for sure what method is responsible to update the docs, (and the one I found is private) so the other way is to just check by the size of results list:

it 'does not call the API if there has been no attribute change' do
  person = People.search('Jane').first
  
  expect {
    person.update(first_name: 'Jane')
  }.to_not change(People.index.tasks['results'], :size)

  expect {
    person.update(first_name: 'Alice')
  }.to change(People.index.tasks['results'], :size).by(1)
end

Do you think this could help covering this case? 🎱

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks good to me to cover the test case. I even remove the second part since the test was doing twice the same test.

Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

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

I left some ideas regarding these changes, let me know if you agree with them!

🥡🍕🐟 for you haha!

before_save_statuses = People.index.get_all_update_status
before_save_status = before_save_statuses.last
before_save_statuses = People.index.tasks['results']
before_save_status = before_save_statuses.first
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about using the find method in this array in order to keep this working even when the order changes?

before_save_status = before_save_statuses.find {|t| t['...'] = ... }

And also for the line below...

@curquiza curquiza requested a review from brunoocasali January 13, 2022 15:54
Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

@brunoocasali brunoocasali merged commit b75a5c9 into bump-meilisearch-v0.25.0 Jan 13, 2022
@brunoocasali brunoocasali deleted the v0.25.0-changes branch January 13, 2022 17:06
bors bot added a commit that referenced this pull request Jan 13, 2022
100: Update version for the next release (v0.4.0) r=brunoocasali a=brunoocasali

Why is it breaking?
- #99
- #92

Other relevant changes:
- #96
- #94

Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change The related changes are breaking for the users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants