@bobfrankston/rmfmail 1.2.202 → 1.2.203
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.
|
@@ -37,14 +37,33 @@ internal static class Program
|
|
|
37
37
|
private static string RmfmailDir =>
|
|
38
38
|
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".rmfmail");
|
|
39
39
|
|
|
40
|
+
/// Trace log (~/.rmfmail/logs/rmfshare.log). The first field failure
|
|
41
|
+
/// (Bob 2026-07-30: share restarted the app, no pending file, no error
|
|
42
|
+
/// box) was undiagnosable because this exe wrote nothing anywhere —
|
|
43
|
+
/// every activation now leaves a breadcrumb trail. Append-only, best
|
|
44
|
+
/// effort, never throws.
|
|
45
|
+
private static void Log(string msg)
|
|
46
|
+
{
|
|
47
|
+
try
|
|
48
|
+
{
|
|
49
|
+
var dir = Path.Combine(RmfmailDir, "logs");
|
|
50
|
+
Directory.CreateDirectory(dir);
|
|
51
|
+
File.AppendAllText(Path.Combine(dir, "rmfshare.log"),
|
|
52
|
+
$"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} {msg}\r\n");
|
|
53
|
+
}
|
|
54
|
+
catch { /* logging must never break the share */ }
|
|
55
|
+
}
|
|
56
|
+
|
|
40
57
|
[STAThread]
|
|
41
58
|
private static int Main()
|
|
42
59
|
{
|
|
43
60
|
try
|
|
44
61
|
{
|
|
45
62
|
IActivatedEventArgs? activation = null;
|
|
63
|
+
string activationError = "";
|
|
46
64
|
try { activation = AppInstance.GetActivatedEventArgs(); }
|
|
47
|
-
catch
|
|
65
|
+
catch (Exception ex) { activationError = ex.Message; }
|
|
66
|
+
Log($"activated: kind={(activation == null ? $"null ({activationError})" : activation.Kind.ToString())}");
|
|
48
67
|
|
|
49
68
|
if (activation is ShareTargetActivatedEventArgs share)
|
|
50
69
|
{
|
|
@@ -63,6 +82,7 @@ internal static class Program
|
|
|
63
82
|
}
|
|
64
83
|
catch (Exception ex)
|
|
65
84
|
{
|
|
85
|
+
Log($"FAILED: {ex}");
|
|
66
86
|
ShowError($"Share to rmfmail failed:\n{ex.Message}");
|
|
67
87
|
return 1;
|
|
68
88
|
}
|
|
@@ -110,7 +130,9 @@ internal static class Program
|
|
|
110
130
|
}
|
|
111
131
|
}
|
|
112
132
|
|
|
133
|
+
Log($"share: title={title.Length}ch text={text.Length}ch url=\"{url}\" files={files.Count}");
|
|
113
134
|
WritePendingShare(title, text, url, files);
|
|
135
|
+
Log("pending-share.json written");
|
|
114
136
|
|
|
115
137
|
try { op.ReportCompleted(); } catch { /* pane may already be gone */ }
|
|
116
138
|
}
|
|
@@ -215,6 +237,7 @@ internal static class Program
|
|
|
215
237
|
// already running (it has the pending file) instead of the default
|
|
216
238
|
// replace-on-launch, which restarted the whole app mid-share.
|
|
217
239
|
if (handoff) psi.ArgumentList.Add("--handoff");
|
|
240
|
+
Log($"launching: {node} {mailxJs}{(handoff ? " --handoff" : "")}");
|
|
218
241
|
Process.Start(psi);
|
|
219
242
|
}
|
|
220
243
|
|
package/bin/rmfshare.exe
CHANGED
|
Binary file
|
package/package.json
CHANGED