Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Improvement/websocket for logs#260

Merged
abdheshnayak merged 4 commits into
release-v1.0.2from
improvement/websocket-for-logs
Feb 8, 2024
Merged

Improvement/websocket for logs#260
abdheshnayak merged 4 commits into
release-v1.0.2from
improvement/websocket-for-logs

Conversation

@abdheshnayak
Copy link
Copy Markdown
Contributor

No description provided.

@abdheshnayak abdheshnayak merged commit 7300455 into release-v1.0.2 Feb 8, 2024
@abdheshnayak abdheshnayak deleted the improvement/websocket-for-logs branch February 8, 2024 14:38
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

PR Type: Enhancement

PR Summary: This pull request introduces enhancements to the websocket server's handling of log subscriptions. It adds a new Event type to better categorize subscription events, refines the generation of consumer IDs for better uniqueness, and updates the handling of log subscriptions and unsubscriptions to include an identifier. Additionally, it modifies the message structures used in websocket communication to align with these changes.

Decision: Comment

📝 Type: 'Enhancement' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.

General suggestions:

  • Consider the security implications of using MD5 for generating consumer IDs. A more secure hashing algorithm like SHA-256 could be used to mitigate known vulnerabilities of MD5.
  • The removal of the unique ID from the log hash calculation might increase the risk of hash collisions. It's important to ensure that the remaining fields provide sufficient uniqueness for the hash.
  • The changes made to the websocket message handling and consumer ID generation appear to align with the goal of enhancing log subscription management. However, it's crucial to ensure these changes are thoroughly tested, especially in scenarios with high concurrency or potential for hash collisions.
  • Given the introduction of the Event type, it might be beneficial to review all places where event types are used to ensure consistency and to leverage the type system for compile-time checks.
  • The addition of an identifier to the subscription management process is a positive step towards better traceability and management of subscriptions. It would be helpful to document the expected behavior and usage of this identifier for future reference.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

return nil, errors.NewE(err)
}

id := uuid.New().String()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (llm): Using MD5 for generating a consumer ID might not be the best choice due to its known vulnerabilities and the fact that it's not collision-resistant. Consider using a more secure hashing algorithm like SHA-256 for better security practices.

abdheshnayak added a commit that referenced this pull request Nov 5, 2024
* 🐛 Fixed issue with memory leak on socket-server

* 🎨 Imporved logic for logs socket
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant