[GH-ISSUE #76] RFC: Wrap all platform interfaces in src/lib/platform and elsewhere #61

Closed
opened 2026-05-05 04:53:47 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @p12tic on GitHub (Jul 1, 2018).
Original GitHub issue: https://github.com/debauchee/barrier/issues/76

Originally assigned to: @p12tic on GitHub.

I propose wrapping the platform interfaces in src/lib/platform and other places with wrapper classes and then only allowing calling the methods of these classes. This would give us the following benefits:

  • Whole Barrier could be mocked, which would allow to easily write tests to prevent regressions
  • We could have wrapper implementation which would log all calls. This would allow much easier diagnostics of any platform-specific bugs that can't be easily reproduced by the developers. The user could just enable the logging functionality, reproduce the bug, collect logs and send them along the bug report. This way it would be possible to investigate the bugs, fix them and write regression tests all without having access to the reproduction environment,

What do you think about this proposal?

Originally created by @p12tic on GitHub (Jul 1, 2018). Original GitHub issue: https://github.com/debauchee/barrier/issues/76 Originally assigned to: @p12tic on GitHub. I propose wrapping the platform interfaces in src/lib/platform and other places with wrapper classes and then only allowing calling the methods of these classes. This would give us the following benefits: - Whole Barrier could be mocked, which would allow to easily write tests to prevent regressions - We could have wrapper implementation which would log all calls. This would allow much easier diagnostics of any platform-specific bugs that can't be easily reproduced by the developers. The user could just enable the logging functionality, reproduce the bug, collect logs and send them along the bug report. This way it would be possible to investigate the bugs, fix them and write regression tests all without having access to the reproduction environment, What do you think about this proposal?
gitea-mirror 2026-05-05 04:53:47 -06:00
Author
Owner

@walker0643 commented on GitHub (Jul 4, 2018):

Discussed via IRC. Will review PRs as they come in.

<!-- gh-comment-id:402561808 --> @walker0643 commented on GitHub (Jul 4, 2018): Discussed via IRC. Will review PRs as they come in.
Author
Owner

@walker0643 commented on GitHub (Sep 8, 2018):

@p12tic are we still working on this?

<!-- gh-comment-id:419676943 --> @walker0643 commented on GitHub (Sep 8, 2018): @p12tic are we still working on this?
Author
Owner

@p12tic commented on GitHub (Sep 9, 2018):

Not at the moment, but it's in progress.

<!-- gh-comment-id:419712217 --> @p12tic commented on GitHub (Sep 9, 2018): Not at the moment, but it's in progress.
Author
Owner

@walker0643 commented on GitHub (Sep 10, 2018):

Closing this issue but I'm looking forward to the PRs.

<!-- gh-comment-id:420067000 --> @walker0643 commented on GitHub (Sep 10, 2018): Closing this issue but I'm looking forward to the PRs.
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: github-starred/barrier#61
No description provided.