aicam commented on code in PR #8078:
URL: https://github.com/apache/texera/pull/8078#discussion_r3891429255


##########
frontend/src/app/dashboard/component/user/user-model/user-model-explorer/model-detail.component.ts:
##########
@@ -350,4 +429,131 @@ export class ModelDetailComponent implements OnInit {
     }
     return this.modelIsDownloadable && (this.modelIsPublic || 
this.userModelAccessLevel !== "NONE");
   }
+
+  userHasWriteAccess(): boolean {
+    return this.userModelAccessLevel === "WRITE";
+  }
+
+  onPreviouslyUploadedFileDeleted(node: DatasetFileNode): void {
+    if (!this.mid) {
+      return;
+    }
+    const relativePath = getRelativePathFromDatasetFileNode(node);
+    this.stagedFileService
+      .deleteFile(this.modelEndpoint, this.mid, relativePath)
+      .pipe(untilDestroyed(this))
+      .subscribe({
+        next: () => {
+          this.notificationService.success(
+            `File ${node.name} is successfully deleted. You may finalize it or 
revert it at the "Create Version" panel`
+          );
+          // Undefined only when the panel is not rendered, which is the same 
write-access
+          // condition that gates the tree's delete control.
+          this.versionUploader?.notePathStaged(relativePath);
+        },
+        error: () => this.notificationService.error("Failed to delete the 
file"),
+      });
+  }
+
+  /** Commits the staged files; the panel owns the rest of the version flow. */
+  createModelVersion = (versionName: string): Observable<unknown> =>
+    this.modelService.createModelVersion(this.mid!, versionName);
+
+  onVersionCreated(): void {
+    this.retrieveModelVersionList();
+  }
+
+  // 
===========================================================================
+  // Settings
+  // 
===========================================================================
+
+  onSaveModelName(): void {

Review Comment:
   A rename here invalidates any upload that is still in flight.
   
   `multipartUpload()` takes `resourceName` as an argument, so it captured the 
old name at start. Once this updates `modelName`, the remaining `part` and 
`finish` calls keep sending the old name and the backend resolves them through 
`getModelBy(ownerEmail, modelName)` -> 404. Aborting doesn't rescue it either: 
`onClickAbortUploadProgress` reads `this.resourceName` at click time, i.e. the 
new name, so the abort 404s as well and the session is left behind for the 
retry loop to grind through.
   
   Narrow, since Settings is a separate tab from the upload panel -- but model 
uploads default to a 2048 MiB per-file ceiling, so they run long enough for a 
tab switch to be realistic.
   
   Cheapest fix is to disable the name field while `activeCount > 0`. Otherwise 
the panel needs to abort in-flight uploads under the old name before the rename 
lands.



##########
frontend/src/app/dashboard/component/user/files-uploader/files-uploader.component.ts:
##########
@@ -75,17 +79,21 @@ export class FilesUploaderComponent {
   fileUploadingFinished: boolean = false;
   fileUploadBannerType: "error" | "success" | "info" | "warning" = "success";
   fileUploadBannerMessage: string = "";
-  singleFileUploadMaxSizeMiB: number = 20;
+  singleFileUploadMaxSizeMiB: number = 
DATASET_FILE_RESOURCE_ENDPOINT.defaultMaxFileSizeMiB;
 
   constructor(
     private notificationService: NotificationService,
     private adminSettingsService: AdminSettingsService,
-    private datasetService: DatasetService,
+    private multipartUploadService: MultipartUploadService,
     private modal: NzModalService
-  ) {
-    // A missing key or failed fetch keeps the initializer default above.
+  ) {}
+
+  // The ceiling is read here rather than in the constructor because 
`endpoint` is an @Input, and it
+  // decides both the setting key and the fallback. A missing key or failed 
fetch keeps the fallback.
+  ngOnInit(): void {
+    this.singleFileUploadMaxSizeMiB = this.endpoint.defaultMaxFileSizeMiB;
     this.adminSettingsService
-      .getPublicSetting("dataset_single_file_upload_max_size_mib")
+      .getPublicSetting(this.endpoint.maxFileSizeSettingKey)

Review Comment:
   The PR description says the extracted upload code read 
`single_file_upload_max_size_mib`, "a key that does not exist", and that every 
dataset upload would have silently fallen back to 20 MiB.
   
   I can't find that in this diff. The line this replaces already read 
`dataset_single_file_upload_max_size_mib`, and `main` uses the prefixed keys in 
`files-uploader`, `dataset-detail` and `admin-settings` alike -- nothing in the 
32 files changes an unprefixed key. I assume it was true against an earlier 
commit on the branch.
   
   Worth correcting in the description, otherwise reviewers go hunting for a 
fix that isn't in the diff. The endpoint constants themselves are right: all 
eight keys and both defaults match `UploadLimits.scala`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to