Workaround for message id
This commit is contained in:
		| @@ -31,7 +31,9 @@ async function run() { | |||||||
|   console.log("Started watching changes in database"); |   console.log("Started watching changes in database"); | ||||||
|  |  | ||||||
|   const writeMessage = (response, blob) => { |   const writeMessage = (response, blob) => { | ||||||
|     const message = `id: ${blob._id}\nevent: message\ndata: ${JSON.stringify(blob)}\n\n` |     // TODO: why no id? | ||||||
|  |     const id = blob._id || null | ||||||
|  |     const message = `id: ${id}\nevent: message\ndata: ${JSON.stringify(blob)}\n\n` | ||||||
|     response.write(message) |     response.write(message) | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user