Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Added some checks for resolvers after removes #8936

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

barankyle
Copy link
Member

@barankyle barankyle commented Sep 29, 2023

Summary

Avatar removal was returning errors. This was caused by the avatarResolver fetching model and thumbnail static-resources, but on avatar deletion, these have been removed, which makes the .get's error. Made this not trigger when context.event is 'removed', and applied this to other resolvers that fetch static-resources.

Cleaned up some redundant function calls that are assigned to variables before just returning the variable.

🤖 Generated by Copilot at 94fcdac

This pull request refactors and optimizes various virtual fields in the resolvers of different entities in packages/server-core/src. It removes unnecessary conditions, variables, and return statements, and avoids database queries for deleted entities. The purpose is to improve the performance, readability, and error handling of the resolvers.

References

closes #8930

Explanation

🤖 Generated by Copilot at 94fcdac

🤖 Generated by Copilot at 94fcdac

We are the masters of the code
We slash the queries and the load
We make the fields concise and clear
We crush the errors and the fear

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

Avatar removal was returning errors. This was caused by the avatarResolver fetching
model and thumbnail static-resources, but on avatar deletion, these have been removed,
which makes the .get's error. Made this not trigger when context.event is 'removed',
and applied this to other resolvers that fetch static-resources.

Cleaned up some redundant function calls that are assigned to variables before just
returning the variable.
@hanzlamateen hanzlamateen added this pull request to the merge queue Oct 2, 2023
Merged via the queue into dev with commit c9c37aa Oct 2, 2023
14 checks passed
@hanzlamateen hanzlamateen deleted the 8930-delete-avatar-bugfix branch October 2, 2023 10:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Deleting avatars returns errors
2 participants