fix: Fixed paddle relink sub
Chart Release / chart (push) Successful in 27s
Server Deploy / deploy (push) Successful in 1m17s

This commit is contained in:
2026-08-03 17:34:39 +01:00
parent b5f684c4fe
commit 287bd9657b
5 changed files with 127 additions and 88 deletions
+4 -4
View File
@@ -124,9 +124,9 @@ func handleSubscription(ctx context.Context, ev Event) error {
}
// resolveInstance finds the instance a webhook's custom_data names, following the
// placeholder alias when the id is one a self-hosted claim has since replaced.
// It returns the instance's CURRENT id, which is the only id anything else should
// be written against.
// identity trail when the id is one a placeholder claim or a relink has since
// replaced. It returns the instance's CURRENT id, which is the only id anything
// else should be written against.
func resolveInstance(ctx context.Context, customDataID string) (string, models.Instance, error) {
var inst models.Instance
err := db.Admin("admin_instances").FindOne(ctx,
@@ -138,7 +138,7 @@ func resolveInstance(ctx context.Context, customDataID string) (string, models.I
return "", inst, err
}
if err := db.Admin("admin_instances").FindOne(ctx,
bson.M{"linked_from_placeholder_id": customDataID}).Decode(&inst); err != nil {
bson.M{"previous_instance_ids": customDataID}).Decode(&inst); err != nil {
return "", inst, err
}
return inst.InstanceID, inst, nil