Today, I found a bug on the my website

The problem is that when a user likes a poem, the age restriction set by the author when adding the poem is removed.

0
0
0
0
0
0
0
0
0
0
0
0
0
My website is where users can add their poems and share them with the world. The site is in the Tatar language

Here are the technical details: there is an "update" event that triggers when an author edits a poem. During this event, the system deletes the old age restrictions and adds new ones if they were changed. However, there's an issue: the ratings for poems are stored in the same table as the poems. When a user likes or dislikes a poem, the rating field is updated (+1 or -1). The system treats this as an "update" and triggers the event. As a result, the age restrictions for the poem are removed, even though they were not changed.

Republic of Tatarstan Baltaç Baltaç District
0
0
0
0
0
0
0
0
0
0
0
0
0
1 min read
127
The journey doesn't end here. This post can also be discussed on my Telegram channel, where readers gather to exchange ideas, share opinions, and celebrate interesting content together. You're warmly welcome to join the conversation!
No comments yet
Be the first to share a thought — your note can help the next reader.