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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: Adding multiple many to many relationship attributes to the same collection gets stuck at processing status #6887

Closed
2 tasks done
nikkyeya opened this issue Oct 12, 2023 · 3 comments
Assignees
Labels
bug Something isn't working feature / relationships Fixes and upgrades for database relationships product / databases Fixes and upgrades for the Appwrite Database.

Comments

@nikkyeya
Copy link

nikkyeya commented Oct 12, 2023

馃憻 Reproduction steps

When I created multiple relationship attributes within the same collection, I observed that the second attribute became stuck in a 'failed' status, while the other side of the relationship remained in a 'processing' status.

Also, adding relationship attributes with custom key names within the same collection sometimes failed.
Recording: https://www.awesomescreenshot.com/video/21552043?key=c3c8dde9e73f0bc09a0fdc67499d2bfa

Please

馃憤 Expected behavior

It should display a 'failed' status on both ends and automatically remove the attribute from the list. Alternatively, consider preventing users from adding multiple many-to-many relationship fields within the same collection if full support is not available at the moment.

馃憥 Actual Behavior

I actually was able to add the second many-to-many relationship, but it remained stuck in a 'failed/processing' status. The 'processing' status misled me into thinking I should wait for it to be resolved.

馃幉 Appwrite version

Appwrite Cloud

馃捇 Operating system

Windows

馃П Your Environment

Appwrite ^13.0.0
Client SDK
Cloud Console

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@nikkyeya nikkyeya added the bug Something isn't working label Oct 12, 2023
@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Oct 12, 2023
@stnguyen90
Copy link
Contributor

@nikkyeya, thanks for raising this issue! 馃檹馃徏

FYI, the problem is a many-to-many relationship attribute creates a junction collection (extra table) with the name:

'_' . $collection->getInternalId() . '_' . $relatedCollection->getInternalId()

source

This causes problems if you want multiple relationships on the same collections.

@johnschatner
Copy link

This happened to me yesterday and the ominous part is that the backend completely stopped working, I couldn't access the data from any documents within a collection that had the "failed" and or "processing" status. I couldn't delete the attribute either. This led to me having to create three seperate collections and add the data all over. The logs were very misleading, it said that the attribute ID didn't exist when trying to delete the attribute, but when trying to re add the same attribute it would say that it already exists.

@stnguyen90 stnguyen90 added the feature / relationships Fixes and upgrades for database relationships label Oct 31, 2023
@spencer237
Copy link

This also happened to me, but unlike @johnschatner , the backend was still working and I was able to remove the attribute without a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature / relationships Fixes and upgrades for database relationships product / databases Fixes and upgrades for the Appwrite Database.
Projects
Status: Done
Development

No branches or pull requests

5 participants