-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
Description
When creating a new MUC room via API or any other method, the created_at field in the muc_room database table is set to 1970-01-02 00:00:00 instead of the actual creation time.
Steps to Reproduce
- Create a new MUC room:
curl -X POST http://localhost:5285/api/create_room_with_opts \
-H "Content-Type: application/json" \
-d '{
"room": "testroom",
"service": "conference.localhost",
"host": "localhost",
"options": [{"name": "persistent", "value": "true"}]
}'- Check database:
SELECT name, created_at FROM muc_room WHERE name='testroom';- Result:
created_at = 1970-01-02 00:00:00❌
Expected Behavior
created_at should be set to the current timestamp.
Root Cause
In src/mod_muc_sql.erl, the code uses hibernation_time to set created_at. When a room is first created, hibernation_time is not set, defaulting to 1970-01-02 00:00:00.
Environment
- ejabberd: 25.03 (affects all versions)
- Database: MySQL/PostgreSQL/SQLite
- OS: Linux
Proposed Solution
I have a PR ready that:
- Adds
updated_atcolumn to track modifications - Ensures
created_atis set correctly and never changes - Separates
created_at,updated_at, andhibernation_timeconcerns
YonesSohrabi
Metadata
Metadata
Assignees
Labels
No labels