Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Multiple Create File Events for Chunked Uploads #4507

Open
2 tasks done
stnguyen90 opened this issue Oct 14, 2022 · 2 comments
Open
2 tasks done

🐛 Bug Report: Multiple Create File Events for Chunked Uploads #4507

stnguyen90 opened this issue Oct 14, 2022 · 2 comments
Labels
bug Something isn't working product / storage Fixes and upgrades for the Appwrite Storage.

Comments

@stnguyen90
Copy link
Contributor

👟 Reproduction steps

  1. Subscribe to files via Realtime API or create a Function that triggers on file creation
  2. Create a file bigger than 5MB

👍 Expected behavior

1 event is triggered after the file is created.

👎 Actual Behavior

An event is triggered for each chunked upload. For example, I uploaded a 9.7MB file and got 2 realtime events:

1st:

{
  "events": [
    "buckets.testBucket.files.6349d8c40e01c69018ae.create",
    "buckets.*.files.*.create",
    "buckets.testBucket.files.*.create",
    "buckets.*.files.6349d8c40e01c69018ae.create",
    "buckets.testBucket.files.6349d8c40e01c69018ae",
    "buckets.*.files.*",
    "buckets.testBucket.files.*",
    "buckets.*.files.6349d8c40e01c69018ae",
    "buckets.testBucket",
    "buckets.*"
  ],
  "channels": [
    "files",
    "buckets.testBucket.files",
    "buckets.testBucket.files.6349d8c40e01c69018ae"
  ],
  "timestamp": "2022-10-14 21:46:44.071",
  "payload": {
    "$id": "6349d8c40e01c69018ae",
    "bucketId": "testBucket",
    "$createdAt": "2022-10-14T21:46:44.066+00:00",
    "$updatedAt": "2022-10-14T21:46:44.066+00:00",
    "$permissions": [
      "read(\"user:632235088a84d5fbdb45\")",
      "update(\"user:632235088a84d5fbdb45\")",
      "delete(\"user:632235088a84d5fbdb45\")"
    ],
    "name": "sample-jpg-file-for-testing.jpeg",
    "signature": "",
    "mimeType": "",
    "sizeOriginal": 9748247,
    "chunksTotal": 2,
    "chunksUploaded": 1
  }
}

2nd:

{
  "events": [
    "buckets.testBucket.files.6349d8c40e01c69018ae.create",
    "buckets.*.files.*.create",
    "buckets.testBucket.files.*.create",
    "buckets.*.files.6349d8c40e01c69018ae.create",
    "buckets.testBucket.files.6349d8c40e01c69018ae",
    "buckets.*.files.*",
    "buckets.testBucket.files.*",
    "buckets.*.files.6349d8c40e01c69018ae",
    "buckets.testBucket",
    "buckets.*"
  ],
  "channels": [
    "files",
    "buckets.testBucket.files",
    "buckets.testBucket.files.6349d8c40e01c69018ae"
  ],
  "timestamp": "2022-10-14 21:46:45.409",
  "payload": {
    "$id": "6349d8c40e01c69018ae",
    "bucketId": "testBucket",
    "$createdAt": "2022-10-14T21:46:44.066+00:00",
    "$updatedAt": "2022-10-14T21:46:45.402+00:00",
    "$permissions": [
      "read(\"user:632235088a84d5fbdb45\")",
      "update(\"user:632235088a84d5fbdb45\")",
      "delete(\"user:632235088a84d5fbdb45\")"
    ],
    "name": "sample-jpg-file-for-testing.jpeg",
    "signature": "b08922ff6b62fdec4d4a7ad651d965ca",
    "mimeType": "image/jpeg",
    "sizeOriginal": 9748247,
    "chunksTotal": 2,
    "chunksUploaded": 2
  }
}

🎲 Appwrite version

Version 1.0.x

💻 Operating system

Linux

🧱 Your Environment

Tested against Appwrite Version 1.0.2

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@stnguyen90 stnguyen90 added bug Something isn't working product / storage Fixes and upgrades for the Appwrite Storage. labels Oct 14, 2022
@ajitsinghkaler
Copy link

I can't understand the use case of creating multiple events on chunked upload.

There is separate way of progress tracking. So, why are multiple events fired on chunked uploads.

joern-h added a commit to joern-h/appwrite that referenced this issue Oct 12, 2023
joern-h added a commit to joern-h/appwrite that referenced this issue Oct 13, 2023
@stnguyen90
Copy link
Contributor Author

@ajitsinghkaler each API triggers an event when it executes successfully. The create file API is called for each chunk.

joern-h added a commit to joern-h/appwrite that referenced this issue Nov 2, 2023
joern-h added a commit to joern-h/appwrite that referenced this issue Nov 13, 2023
joern-h added a commit to joern-h/appwrite that referenced this issue Nov 17, 2023
joern-h added a commit to joern-h/appwrite that referenced this issue Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / storage Fixes and upgrades for the Appwrite Storage.
Projects
None yet
Development

No branches or pull requests

2 participants