rtcharity / eahub.org

A global directory for effective altruists to connect
https://eahub.org
MIT License
18 stars 6 forks source link

Profiles don't update in Algolia #1283

Open viktor-yunenko opened 3 years ago

viktor-yunenko commented 3 years ago

eg a user approval through the admin panel doesn't push them into the index (tested on prod)

cc sebgrebe

viktor-yunenko commented 3 years ago

@sebgrebe, FYI I also noticed that there's an issue with the outdated tags index, which could be related. It's why the 400 issue on tags is happening even although we fixed the bug on Sunday. The server returns Invalid pk "9" - object does not exist, which usually means that there's a tag in algolia that doesn't exist on the backend. Eg that tag is on the stage server only.

Details: https://sentry.io/organizations/eahub/issues/2401386725/events/b4f480e0d3454b689beed9a7e4ec2efa/?project=5545929

sebgrebe commented 3 years ago

I'm starting to look at this now, @victor-yunenko

sebgrebe commented 3 years ago

@victor-yunenko, I found the culprit:

Finally, realize that update() does an update at the SQL level and, thus, does not call any save() methods on your models, nor does it emit the pre_save or post_save signals (which are a consequence of calling Model.save()).

django docs