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

Reindex fails when using API key limited by suffix #343

Open
Spone opened this issue Mar 21, 2019 · 2 comments
Open

Reindex fails when using API key limited by suffix #343

Spone opened this issue Mar 21, 2019 · 2 comments

Comments

@Spone
Copy link
Contributor

Spone commented Mar 21, 2019

  • Rails version: any
  • Algolia Rails integration version: 1.22.0
  • Algolia Client Version: 1.26.0

Description

When calling .reindex on a model, a temporary index is created, with the .tmp prefix.
In my case, I'm limiting my API keys access to a specific index name pattern (*_development for instance), so the reindex fails because the .tmp index can't be accessed.

Steps To Reproduce

  • Create an API key limited to *_development
  • Create a model such as Page, when the corresponding index name is Page_development
  • Call Page.reindex and see it fail

I'm not sure what the best way to handle this case is... maybe always allow the .tmp-prefixed models for any API key?

@julienbourdeau
Copy link
Contributor

There is a note in the doc about that here: https://www.algolia.com/doc/framework-integration/rails/indices/#atomical-reindexing I kept it in the [new version].

Do you have any idea about to make it clearer? I could add an example like:

You must allow ['*_development', '*_development.tmp']

@Spone
Copy link
Contributor Author

Spone commented Mar 22, 2019

I simply did not see it... 😕

Maybe mention it in the error message? I was confused and double checked my API keys a few times before understanding the issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants