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

Fix Urdr panic when user has starred a closed issue #1003

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

kusalananda
Copy link
Member

The issues.json Redmine endpoint does not, by default, return data for closed issues. This means that when a user has starred a Redmine issue that later is closed, Urdr can't find any information about it and panics. The panic is due to accessing the first element from an empty array, which is empty because there was no information from Redmine about the issue, because it was closed.

Related issue(s) and PR(s)

This PR closes #1002.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

List of changes made

This PR allows us to find the project ID for closed Redmine issues that a user has starred in Urdr. This is done by adding status_id=* as a query parameter to the relevant REST API call.

Screenshot of the fix

Testing

To test: Star a closed issue (for example 7398) and reload. You will have problem seeing your favourites.

With the PR, this should work.

Further comments

Definition of Done checklist

  • I have made an effort making the commit history understandable
  • I have performed a self-review of my own code and commented any hard-to-understand areas
  • Tests and lint/format validations are passing
  • My changes generate no new warnings

This allows us to find the project ID for closed Redmine issues that
a user has starred in Urdr.  The "issues.json" Redmine endpoint does not
usually return data for closed issues.
Copy link
Contributor

@KattisLej KattisLej left a comment

Choose a reason for hiding this comment

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

Great job, now the favourites were loaded although I had a closed issue as a favourite

@kusalananda kusalananda merged commit ac128eb into develop Oct 17, 2024
10 checks passed
@kusalananda kusalananda deleted the 1002-fix-panic branch October 17, 2024 07:44
@kusalananda kusalananda self-assigned this Oct 17, 2024
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.

Service sometimes restarts after "panic"
2 participants