Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2657af9

Browse filesBrowse files
jbowringjc21
authored andcommitted
Fix stream update not persisting
1 parent 4452f01 commit 2657af9
Copy full SHA for 2657af9

File tree

1 file changed

+13
-9
lines changed
Filter options

1 file changed

+13
-9
lines changed

‎backend/internal/stream.js

Copy file name to clipboardExpand all lines: backend/internal/stream.js
+13-9Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ const internalStream = {
3535
data.meta = {};
3636
}
3737

38-
let data_no_domains = structuredClone(data);
39-
4038
// streams aren't routed by domain name so don't store domain names in the DB
39+
let data_no_domains = structuredClone(data);
4140
delete data_no_domains.domain_names;
4241

4342
return streamModel
@@ -73,7 +72,7 @@ const internalStream = {
7372
// Configure nginx
7473
return internalNginx.configure(streamModel, 'stream', row)
7574
.then(() => {
76-
return internalStream.get(access, {id: row.id, expand: ['owner']});
75+
return row;
7776
});
7877
})
7978
.then((row) => {
@@ -140,12 +139,6 @@ const internalStream = {
140139
.query()
141140
.patchAndFetchById(row.id, data)
142141
.then(utils.omitRow(omissions()))
143-
.then((saved_row) => {
144-
return internalNginx.configure(streamModel, 'stream', saved_row)
145-
.then(() => {
146-
return internalStream.get(access, {id: row.id, expand: ['owner']});
147-
});
148-
})
149142
.then((saved_row) => {
150143
// Add to audit log
151144
return internalAuditLog.add(access, {
@@ -158,6 +151,17 @@ const internalStream = {
158151
return saved_row;
159152
});
160153
});
154+
})
155+
.then(() => {
156+
return internalStream.get(access, {id: data.id, expand: ['owner', 'certificate']})
157+
.then((row) => {
158+
return internalNginx.configure(streamModel, 'stream', row)
159+
.then((new_meta) => {
160+
row.meta = new_meta;
161+
row = internalHost.cleanRowCertificateMeta(row);
162+
return _.omit(row, omissions());
163+
});
164+
});
161165
});
162166
},
163167

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.