[PR #438] [MERGED] Make sequences wrap around to avoid overflows #926

Closed
opened 2026-02-27 20:00:29 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/438
Author: @Malvineous
Created: 2/23/2020
Status: Merged
Merged: 2/27/2020
Merged by: @sashahilton00

Base: devHead: patch-3


📝 Commits (1)

  • 036f1f7 Make sequences wrap around to avoid overflows

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 core/src/util/mod.rs (+1 -1)

📄 Description

Instead of aborting with an attempt to add with overflow error, wrap the sequence around so that it goes back to 0 once it has reached the maximum value for the integer type. Fixes #437.

Everything that uses sequences seems to treat them as unique values for matching asynchronous responses back to requests, so having the sequence number wrap at some point long after the original response has been received should cause no problems.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/438 **Author:** [@Malvineous](https://github.com/Malvineous) **Created:** 2/23/2020 **Status:** ✅ Merged **Merged:** 2/27/2020 **Merged by:** [@sashahilton00](https://github.com/sashahilton00) **Base:** `dev` ← **Head:** `patch-3` --- ### 📝 Commits (1) - [`036f1f7`](https://github.com/librespot-org/librespot/commit/036f1f7cec2664310dda7140af1861ab0da1ee8d) Make sequences wrap around to avoid overflows ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `core/src/util/mod.rs` (+1 -1) </details> ### 📄 Description Instead of aborting with an `attempt to add with overflow` error, wrap the sequence around so that it goes back to 0 once it has reached the maximum value for the integer type. Fixes #437. Everything that uses sequences seems to treat them as unique values for matching asynchronous responses back to requests, so having the sequence number wrap at some point long after the original response has been received should cause no problems. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:00:29 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#926
No description provided.