-
Notifications
You must be signed in to change notification settings - Fork 6
remove logging qr code generation to history #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes unnecessary logging of QR code generation to the history table, improves code documentation, and cleans up legacy QR code handling. The changes streamline QR code generation by eliminating redundant history entries while maintaining proper tracking of when boxes receive new QR codes.
Key changes:
- Removed history logging for QR code generation events
- Added clarifying comments to QR code generation logic
- Removed legacy QR code handling and database fields
- Consolidated history logging to track only when boxes get new QR codes
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
pdf/qr.php | Removed legacy QR code handling, consolidated history logging, and added explanatory comments |
include/qr.php | Removed QR code generation history logging and added section comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pylipp I'm missing here the db migration to remove the old QR history entries.
Also it is removing the legacy bits which we maybe should investigate how important that still is. I can explain the origin of the legacy flag.
@pylipp pls check in production if there are any active QR-code who are legacy QR-codes that are not part of Drop in the Ocean. |
Agreed with @HaGuesto : not relevant since the only partner of legacy QR codes, DitO, is not with us anymore.
There's 17k QR codes with the legacy flag but 0 connected to boxes in active camps: select count(qr.id) from qr
inner join stock b on b.qr_id = qr.id
inner join locations l on l.id = b.location_id
inner join camps c on c.id = l.camp_id
where legacy = 1
and (b.deleted is null or not b.deleted)
and (l.deleted is null or not l.deleted)
and (c.deleted is null or not c.deleted)
; In camps of other orgs, there are 4 legacy QR codes in an inactive R4R camp and 3 legacy QR codes with deleted boxes/locations in IHA's camp (QR codes were created in 2017 and 2018; these boxes were moved from DitO to IHA in 2021/2022). select c.id,b.box_state_id ,qr.created,b.created ,b.deleted ,l.deleted , c.deleted from qr
inner join stock b on b.qr_id = qr.id
inner join locations l on l.id = b.location_id
inner join camps c on c.id = l.camp_id
where legacy = 1
and c.organisation_id != 10
order by c.id
; |
There are no legacy QR codes in any active bases anymore
This removes the entries ``` changes |count(id)| max(changedate) ----------------------------+---------+ New QR-code generated | 42391| -- 2024-06-24 (see below. There are 30 newer log entries since 2025-08-25 through the v2 createQrCode functionality) New QR-code generated by pdf| 97198| -- 2024-06-24 (in Feb 2024, the underlying simpleBulkSaveChangeHistory function was incorrectly updated (98be57f); released in v1.24.0 on 2024-06-25) QR code associated to box. | 62519| -- 2023-12-06 (in Nov 2023, the corresponding mobile functionality was deleted; released in v1.23.4 on 2023-12-08) ```
3812915
to
885b8ca
Compare
added it now |
https://trello.com/c/70vc78uU