@fireemu/linux-arm64 0.26.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @fireemu/linux-arm64
2
2
 
3
3
  The [fireemu](https://www.npmjs.com/package/fireemu) daemon built for `linux-arm64`
4
- (Rust target `aarch64-unknown-linux-musl`), version 0.26.0.
4
+ (Rust target `aarch64-unknown-linux-musl`), version 0.27.0.
5
5
 
6
6
  Statically linked against musl: any glibc or musl distribution, including distroless and Alpine.
7
7
 
package/bin/fireemu CHANGED
Binary file
@@ -1519,9 +1519,13 @@ async function invoke(functions, manifest, msg) {
1519
1519
  spec,
1520
1520
  async () => {
1521
1521
  if (spec.generation === 1) {
1522
- const context = v1Context(msg);
1522
+ // A Gen1 schedule also receives ordinary publishes to its own job topic, with the original message and context.
1523
+ const publishedToSchedule = strictProfile() && msg.trigger === "schedule" &&
1524
+ msg.event.type === "google.cloud.pubsub.topic.v1.messagePublished" &&
1525
+ msg.event.source === `//pubsub.googleapis.com/projects/${process.env.GCLOUD_PROJECT}/topics/firebase-schedule-${spec.name}-${spec.region || "us-central1"}`;
1526
+ const context = v1Context(publishedToSchedule ? { ...msg, trigger: "pubsub" } : msg);
1523
1527
  let data = msg.event.data;
1524
- if (msg.trigger === "schedule") data = {};
1528
+ if (msg.trigger === "schedule") data = publishedToSchedule ? msg.event.data.message : {};
1525
1529
  // v1 `topic().onPublish(message, context)`: the message itself is the data.
1526
1530
  if (msg.trigger === "pubsub") data = msg.event.data.message;
1527
1531
  await fn(data, context);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fireemu/linux-arm64",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "The fireemu daemon for linux-arm64",
5
5
  "homepage": "https://github.com/t-k/fireemu#readme",
6
6
  "repository": {