tangled
alpha
login
or
join now
yoten.app
/
yoten
17
fork
atom
Yōten: A social tracker for your language learning journey built on the atproto.
17
fork
atom
overview
issues
pulls
pipelines
feat: add notifications to db on ingest
brookjeynes.dev
6 months ago
11daa1aa
63e15018
verified
This commit was signed with the committer's
known signature
.
brookjeynes.dev
SSH Key Fingerprint:
SHA256:N3n3PCBSiXfS6EHlmGdx+LMEruJMj6FS2hqaXyfsw0s=
+13
1 changed file
expand all
collapse all
unified
split
internal
consumer
ingester.go
+13
internal/consumer/ingester.go
···
391
391
tx.Rollback()
392
392
return fmt.Errorf("failed to upsert activity def record: %w", err)
393
393
}
394
394
+
395
395
+
subjectUri := fmt.Sprintf("at://%s/%s/%s", did, yoten.GraphFollowNSID, e.Commit.RKey)
396
396
+
err = db.CreateNotification(tx, subjectDid, did, subjectUri, db.NotificationTypeFollow)
397
397
+
if err != nil {
398
398
+
log.Println("failed to create notification record:", err)
399
399
+
}
400
400
+
394
401
return tx.Commit()
395
402
case models.CommitOperationDelete:
396
403
log.Println("deleting follow from pds request")
···
462
469
tx.Rollback()
463
470
return fmt.Errorf("failed to upsert activity def record: %w", err)
464
471
}
472
472
+
473
473
+
err = db.CreateNotification(tx, subjectDid.String(), did, subject.String(), db.NotificationTypeReaction)
474
474
+
if err != nil {
475
475
+
log.Println("failed to create notification record:", err)
476
476
+
}
477
477
+
465
478
return tx.Commit()
466
479
case models.CommitOperationDelete:
467
480
log.Println("deleting reaction from pds request")