[PR #425] [MERGED] fix: improve LDAP error handling #814

Closed
opened 2025-10-09 16:57:45 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/425
Author: @ItalyPaleAle
Created: 4/10/2025
Status: Merged
Merged: 4/13/2025
Merged by: @kmendell

Base: mainHead: ldap-error-handling


📝 Commits (4)

  • 25ceb01 Improve error handling for LDAP
  • 511391c Fixed: detect group
  • 4d9768f Merge branch 'main' into ldap-error-handling
  • c5b9917 Merge branch 'main' into ldap-error-handling

📊 Changes

6 files changed (+239 additions, -103 deletions)

View changed files

📝 backend/internal/common/errors.go (+7 -0)
📝 backend/internal/controller/user_group_controller.go (+1 -1)
📝 backend/internal/service/ldap_service.go (+124 -82)
backend/internal/service/ldap_service_test.go (+73 -0)
📝 backend/internal/service/user_group_service.go (+7 -8)
📝 backend/internal/service/user_service.go (+27 -12)

📄 Description

This PR revises how errors are handled in the LDAP syncing service. I went through line-by-line to make sure that we treat errors consistently, and in most cases we should abort the sync and roll-back the changes in the DB (with some exceptions).

Should hopefully fix errors that were happening with syncing from LDAP, as some errors were simply logged while others causes failures.


🔄 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/pocket-id/pocket-id/pull/425 **Author:** [@ItalyPaleAle](https://github.com/ItalyPaleAle) **Created:** 4/10/2025 **Status:** ✅ Merged **Merged:** 4/13/2025 **Merged by:** [@kmendell](https://github.com/kmendell) **Base:** `main` ← **Head:** `ldap-error-handling` --- ### 📝 Commits (4) - [`25ceb01`](https://github.com/pocket-id/pocket-id/commit/25ceb01c66ce6d0eb0d591506e1a44d1f8917b37) Improve error handling for LDAP - [`511391c`](https://github.com/pocket-id/pocket-id/commit/511391c2252bdf3d57cdc0143b7ed244b9d93a18) Fixed: detect group - [`4d9768f`](https://github.com/pocket-id/pocket-id/commit/4d9768f16ca315938d9ae048b513f2f0eb7f339e) Merge branch 'main' into ldap-error-handling - [`c5b9917`](https://github.com/pocket-id/pocket-id/commit/c5b991798da3ad83076e36b15f02334b0e126e57) Merge branch 'main' into ldap-error-handling ### 📊 Changes **6 files changed** (+239 additions, -103 deletions) <details> <summary>View changed files</summary> 📝 `backend/internal/common/errors.go` (+7 -0) 📝 `backend/internal/controller/user_group_controller.go` (+1 -1) 📝 `backend/internal/service/ldap_service.go` (+124 -82) ➕ `backend/internal/service/ldap_service_test.go` (+73 -0) 📝 `backend/internal/service/user_group_service.go` (+7 -8) 📝 `backend/internal/service/user_service.go` (+27 -12) </details> ### 📄 Description This PR revises how errors are handled in the LDAP syncing service. I went through line-by-line to make sure that we treat errors consistently, and in most cases we should abort the sync and roll-back the changes in the DB (with some exceptions). Should hopefully fix errors that were happening with syncing from LDAP, as some errors were simply logged while others causes failures. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-09 16:57:45 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-2#814