fix confusing message when uploading dupes

due to deduplication, it is intentionally impossible to
upload several identical copies of a file in parallel

by default, the up2k client will upload files sorted by
size, which usually leads to dupes being grouped together,
and it will try to do just that

this is by design, as it improves performance on average,
but it also shows the confusing (but technically-correct)
message "resume the partial upload into the original path"

fix this with a more appropriate message

note that this approach was selected in favor of pausing
handshakes while the initial copy finishes uploading,
because that could severely reduce upload performance
by preventing optimal use of multiple connections
This commit is contained in:
ed 2024-09-04 22:03:26 +00:00
parent 735ec35546
commit f1130db131
2 changed files with 8 additions and 1 deletions

View file

@ -493,6 +493,7 @@ var Ls = {
"u_etaprep": '(preparing to upload)', "u_etaprep": '(preparing to upload)',
"u_hashdone": 'hashing done', "u_hashdone": 'hashing done',
"u_hashing": 'hash', "u_hashing": 'hash',
"u_dupdefer": "duplicate; will be processed after all other files",
"u_fixed": "OK!  Fixed it 👍", "u_fixed": "OK!  Fixed it 👍",
"u_cuerr": "failed to upload chunk {0} of {1};\nprobably harmless, continuing\n\nfile: {2}", "u_cuerr": "failed to upload chunk {0} of {1};\nprobably harmless, continuing\n\nfile: {2}",
"u_cuerr2": "server rejected upload (chunk {0} of {1});\nwill retry later\n\nfile: {2}\n\nerror ", "u_cuerr2": "server rejected upload (chunk {0} of {1});\nwill retry later\n\nfile: {2}\n\nerror ",
@ -1029,6 +1030,7 @@ var Ls = {
"u_etaprep": '(forbereder opplastning)', "u_etaprep": '(forbereder opplastning)',
"u_hashdone": 'befaring ferdig', "u_hashdone": 'befaring ferdig',
"u_hashing": 'les', "u_hashing": 'les',
"u_dupdefer": "duplikat; vil bli håndtert til slutt",
"u_fixed": "OK!  Løste seg 👍", "u_fixed": "OK!  Løste seg 👍",
"u_cuerr": "kunne ikke laste opp del {0} av {1};\nsikkert greit, fortsetter\n\nfil: {2}", "u_cuerr": "kunne ikke laste opp del {0} av {1};\nsikkert greit, fortsetter\n\nfil: {2}",
"u_cuerr2": "server nektet opplastningen (del {0} av {1});\nprøver igjen senere\n\nfil: {2}\n\nerror ", "u_cuerr2": "server nektet opplastningen (del {0} av {1});\nprøver igjen senere\n\nfil: {2}\n\nerror ",
@ -1565,6 +1567,7 @@ var Ls = {
"u_etaprep": '(准备上传)', "u_etaprep": '(准备上传)',
"u_hashdone": '哈希完成', "u_hashdone": '哈希完成',
"u_hashing": '哈希', "u_hashing": '哈希',
"u_dupdefer": "这是一个重复文件。它将在所有其他文件上传后进行处理", //m
"u_fixed": "好! 已修复 👍", "u_fixed": "好! 已修复 👍",
"u_cuerr": "上传块 {0} 的 {1} 失败;\n可能无害继续中\n\n文件{2}", "u_cuerr": "上传块 {0} 的 {1} 失败;\n可能无害继续中\n\n文件{2}",
"u_cuerr2": "服务器拒绝上传(块 {0} 的 {1}\n稍后重试\n\n文件{2}\n\n错误 ", "u_cuerr2": "服务器拒绝上传(块 {0} 的 {1}\n稍后重试\n\n文件{2}\n\n错误 ",

View file

@ -156,6 +156,7 @@ function U2pvis(act, btns, uc, st) {
'ERROR': '<span class="err">ERROR</span>', 'ERROR': '<span class="err">ERROR</span>',
'OS-error': '<span class="err">OS-error</span>', 'OS-error': '<span class="err">OS-error</span>',
'found': '<span class="inf">found</span>', 'found': '<span class="inf">found</span>',
'defer': '<span class="inf">defer</span>',
'YOLO': '<span class="inf">YOLO</span>', 'YOLO': '<span class="inf">YOLO</span>',
'done': '<span class="ok">done</span>', 'done': '<span class="ok">done</span>',
}; };
@ -2460,6 +2461,7 @@ function up2k_init(subtle) {
pvis.seth(t.n, 2, L.u_ehstmp, t); pvis.seth(t.n, 2, L.u_ehstmp, t);
var err = "", var err = "",
cls = "ERROR",
rsp = unpre(xhr.responseText), rsp = unpre(xhr.responseText),
ofs = rsp.lastIndexOf('\nURL: '); ofs = rsp.lastIndexOf('\nURL: ');
@ -2489,6 +2491,8 @@ function up2k_init(subtle) {
if (!t.rechecks && (err_pend || err_srcb)) { if (!t.rechecks && (err_pend || err_srcb)) {
t.rechecks = 0; t.rechecks = 0;
t.want_recheck = true; t.want_recheck = true;
err = L.u_dupdefer;
cls = 'defer';
} }
} }
if (rsp.indexOf('server HDD is full') + 1) if (rsp.indexOf('server HDD is full') + 1)
@ -2498,7 +2502,7 @@ function up2k_init(subtle) {
if (!t.t_uploading) if (!t.t_uploading)
st.bytes.finished += t.size; st.bytes.finished += t.size;
pvis.seth(t.n, 1, "ERROR"); pvis.seth(t.n, 1, cls);
pvis.seth(t.n, 2, err); pvis.seth(t.n, 2, err);
pvis.move(t.n, 'ng'); pvis.move(t.n, 'ng');