[PR #138] [MERGED] fix: ensure the downloaded GeoLite2 DB is not corrupted & prevent RW race condition #944

Closed
opened 2025-10-07 00:25:07 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/138
Author: @wargio
Created: 1/20/2025
Status: Merged
Merged: 1/20/2025
Merged by: @stonith404

Base: mainHead: fix-race-condition-mmdb


📝 Commits (2)

  • bdfefd3 Ensure the downloaded mmdb is not corrupted & prevent RW race condition.
  • 51404ca Run go fmt globally & remove 0xa0 char from Dockerfile

📊 Changes

5 files changed (+53 additions, -18 deletions)

View changed files

📝 Dockerfile (+1 -1)
📝 backend/internal/dto/app_config_dto.go (+2 -2)
📝 backend/internal/model/app_config.go (+8 -8)
📝 backend/internal/service/app_config_service.go (+2 -2)
📝 backend/internal/service/geolite_service.go (+40 -5)

📄 Description

This fixes a race condition while updating the mmdb, ensures the downloaded file is not corrupted and avoids pocket-id not being able to generate audit logs with locations due a bad database.

In github you cannot see the char replaced but this is the one.
image


🔄 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/138 **Author:** [@wargio](https://github.com/wargio) **Created:** 1/20/2025 **Status:** ✅ Merged **Merged:** 1/20/2025 **Merged by:** [@stonith404](https://github.com/stonith404) **Base:** `main` ← **Head:** `fix-race-condition-mmdb` --- ### 📝 Commits (2) - [`bdfefd3`](https://github.com/pocket-id/pocket-id/commit/bdfefd3ee0faf71afe369de4236c438041c3b533) Ensure the downloaded mmdb is not corrupted & prevent RW race condition. - [`51404ca`](https://github.com/pocket-id/pocket-id/commit/51404ca6984d9dfad9429813fae8c47305248fec) Run go fmt globally & remove 0xa0 char from Dockerfile ### 📊 Changes **5 files changed** (+53 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+1 -1) 📝 `backend/internal/dto/app_config_dto.go` (+2 -2) 📝 `backend/internal/model/app_config.go` (+8 -8) 📝 `backend/internal/service/app_config_service.go` (+2 -2) 📝 `backend/internal/service/geolite_service.go` (+40 -5) </details> ### 📄 Description This fixes a race condition while updating the mmdb, ensures the downloaded file is not corrupted and avoids pocket-id not being able to generate audit logs with locations due a bad database. In github you cannot see the char replaced but this is the one. ![image](https://github.com/user-attachments/assets/91d867bc-fd1f-4822-afa1-a2476b394dc0) --- <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-07 00:25:07 +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#944