Skip to content

feat : Add error attribute to Collection Indexes and Attributes#4575

Merged
abnegate merged 18 commits into
1.4.xfrom
add-error-attribute
Jun 22, 2023
Merged

feat : Add error attribute to Collection Indexes and Attributes#4575
abnegate merged 18 commits into
1.4.xfrom
add-error-attribute

Conversation

@everly-gif

Copy link
Copy Markdown
Contributor

What does this PR do?

Add error attribute to Collection Indexes and Attributes

Test Plan

  • Manual

Related PRs and Issues

NIL

Have you added your change to the Changelog?

yes

Have you read the Contributing Guidelines on issues?

yes

@eldadfux eldadfux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work, left a few comments and points for discussion. Some extra adjustments in utopia/database might be required.

Comment thread app/config/collections.php Outdated
Comment thread app/workers/databases.php
Comment thread src/Appwrite/Utopia/Response/Model/Attribute.php Outdated
Comment thread src/Appwrite/Utopia/Response/Model/Index.php Outdated
Comment thread app/workers/databases.php Outdated
'indexes',
$index->getId(),
$index
->setAttribute('status', 'stuck')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
->setAttribute('status', 'stuck')
->setAttribute('status', 'stuck')

What status types do we support? can we change this to error? cc @christyjacob4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We currently support

  1. available
  2. failed
  3. stuck
  4. deleting
  5. processing

@christyjacob4 christyjacob4 Oct 26, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

failed might make the most sense here. Do we want to deprecate the stuck status ?

Comment thread app/config/collections.php Outdated
Comment thread app/workers/databases.php Outdated
'attributes',
$attribute->getId(),
$attribute
->setAttribute('status', 'stuck')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should deprecate stuck and just use failed instead

@everly-gif everly-gif Oct 26, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

considering this comment here, i think changing it to failed can be misleading.

failed indicates the attribute was never created in the db, whereas stuck
indicates the attribute is available in the db but the deletion operation failed. Since the exception thrown here would only be of a case where the attribute is available in the db, I think stuck makes sense by the definition. If we want to deprecate stuck and go with failed i think we should redefine failed and what it means before doing so.

Comment thread composer.json Outdated
@abnegate abnegate changed the base branch from master to 1.4.x June 15, 2023 01:02
@abnegate abnegate deleted the add-error-attribute branch October 25, 2023 04:46
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

Successfully merging this pull request may close these issues.

4 participants