Patch release.
[elpher.git] / ISSUES.org
1 #+TITLE: Issues and Dev Notes
2 #+TODO: OPEN(o!) | CLOSED(c!) INVALID(i@)
3 #+STARTUP: logdrawer
4
5 * Open Bugs
6
7 ** OPEN Sanitize certificate names
8    :LOGBOOK:
9    - State "OPEN"       from              [2020-06-22 Mon 10:32]
10    :END:
11    
12 Currently things will break in undefined ways if a name is specified
13 that contains path separators and probably other characters that I
14 haven't thought of.  This is dangerously unacceptable and needs to be
15 fixed right away.
16
17 ** OPEN Set timer after creating network process
18
19 While the current order is necessary for synchronous socks
20 connections, it is unecessary for regular connections which have the
21 no-wait flag set.  Furthermore, for these connections, having the
22 timer fire up early means that it interferes with requests for
23 user interaction that may appear during the initial connection setup.
24 E.g., asking for approval of uknown TLS certificates.
25
26 ** OPEN Downloads failing
27
28 Downloads fail when focus is shifted away from
29 the elpher buffer before the download has completed.
30
31 * Closed Bugs
32
33 ** CLOSED Relative Gemini links processed improperly
34 :LOGBOOK:
35 - State "CLOSED"     from "OPEN"       [2021-08-04 Wed 15:54]
36 - State "OPEN"       from              [2021-08-04 Wed 13:53]
37 :END:
38
39 Skyjake's gemlog at gemini://skyjake.fi/gemlog/ demonstrate's the
40 issue.  The link back to the root selector in the footer of that page
41 is a relative link to the parent directory, i.e. "..".  For some
42 reason elpher combines this with the current URL and produces
43 "gemini://skyjake.fi" as the destination of the link.  Such URLs
44 (i.e. without a filename) are allowed as input, but are assumed
45 to not appear internally.
46
47 To see why the internal distinction is important, consider a page
48 where the current URL is gemini://example.com/a_page.  The current
49 directory in this case is "/", meaning a relative link to
50 "another_page" results in a destination link of
51 "gemini://example.com/another_page.  On the other hand, if the current
52 URL is gemini://example.com/a_page/, the same relative link is
53 interpreted as refering to gemini://example.com/a_page/another_page.
54
55 The fix will be to ensure gemini://skyjake.fi/gemlog/.. collapses to
56 gemini://skyjake.fi/ rather than gemini://skyjake.fi.
57
58
59   
60 ** CLOSED Org mode faces are not present in recent emacs versions
61 Even 26.1 doesn't seem to have these.  This means that, for many
62 users, elpher doesn't show any difference between any of the
63 item types.  Not a major problem at all, but the faces we inherit
64 from should definitely be ones which have been present for much
65 longer.  Perhaps the font lock mode faces are the way to go after
66 all.
67
68 Update: changed all default faces to inherit from font-lock and basic faces.
69
70 ** CLOSED URL-centric addressing breaks bookmark file compatibility
71    
72 Need a way to allow people to rescue their old bookmark files
73 following this update.
74
75 ** CLOSED History loops <2019-11-08 Fri>
76
77 Occasionally elpher gets stuck in a "history loop" where a
78 node is its own grandparent.  Obviously this sucks, as history
79 is elpher's main mechanism for making gopherspace exploration
80 painless.
81
82 I suspect the problem is in either ~elpher-visit-node~ or
83 ~elpher-visit-parent~.
84
85 Follow-up: this has been fixed by the new stack-based history system
86 in 2.5.
87
88
89 ** CLOSED Redirects do not rewrite current address
90
91 This is a bug, as gemini://blah.com/hi may get redirected
92 to gemini://blah.com/hi/, at which point link lines
93 of the form "=> there" should be interpreted as pointing
94 at gemini://blah.com/hi/there, while currently they are
95 interpreted as pointing at gemini://blah.com/there.
96
97 ** CLOSED History inconsistency when restarting elpher <2020-05-26 Tue>
98
99 To reproduce:
100 1. open elpher and follow a few links until you're a handful of links below
101    the start page.
102 2. kill the elpher buffer with C-x k
103 3. Open elpher again, which will show the start page.
104 4. Press 'u' to go up.  Elpher wiill respond stating that there is no previous page.
105 5. Press 'u' again. Elpher will then jump to the page that was open when
106    the buffer was originally killed.
107
108 Expected behaviour: elpher should be once again at the bottom of the history
109 stack and should not remember the previous history.
110
111 Observed behaviour: elpher _does_ remember the previous history.
112
113 *** update <2020-05-27 Wed>
114 Turns out this was just because the `elpher` function was merely setting
115 the `elpher-current-page` variable to nil, then using `elpher-visit-page`
116 to visit the start page, resulting in the nil being pushed onto the existing
117 history stack.  Because `elpher-visit-previous-page` always trys to pop from
118 this stack and tests whether the result is nil (which it is when the stack is empty),
119 the first "u" would result in the "no previous page" message but would still
120 pop the stack, meaning that subsequent "u" commands would succeed.
121
122 The fix is just to zero out the history list in the `elpher` function just as
123 `elpher-current-page` is cleared.
124
125 * Open Enhancements
126
127 ** OPEN Allow multiple elpher buffers [33%]
128
129    Shouldn't be too hard, just need elpher-current-node to be
130 buffer-local and allow various buffer-switching procedures to
131 do something sensible.
132
133 Here are the things that need to be implemented before
134 this can happen:
135 - [X] shift history out of node tree and into separate stack
136 - [ ] make history stack variables buffer-local
137 - [ ] have elpher-with-clean-buffer select appropriate buffer 
138    
139 ** OPEN Make installing existing certificates easier
140    :LOGBOOK:
141    - State "OPEN"       from "CLOSED"     [2020-06-22 Mon 10:34]
142    :END:
143
144 It's naive to think that people don't have client certificates created
145 outside of elpher. Thus we need some easy way to "install" these
146 certificates, either by copying them or by referencing them in some
147 way.
148
149 * Closed Enhancements
150   
151 ** CLOSED Turn on lexical scoping
152
153    A branch exists for this, but there are some compilation kinks
154 to iron out.
155
156   
157 ** CLOSED Implement support for telnet entries
158
159 Similar to http entries, telnet entries will be handled by code
160 external to elpher. However it seems I made http entry handling a
161 special case, and I don't want another!  So the only option is to
162 bring both http and telnet entries back into the fold by representing
163 them both as standard nodes and having the grunt work done by getter
164 functions.
165
166 ** CLOSED Allow users to access selected and current node details.
167    
168 ** CLOSED Implement bookmark system
169
170   Currently the bookmark page replaces the current page, and it
171   does so silently (i.e. it doesn't become part of the link hierarchy).
172   I think this is a mistake, as it results in confusing behaviour when
173   traversing the link hierarchy after visiting one of the bookmarked links.
174
175   Instead, I think I should
176   1. Make the bookmark page part of the hierarchy, and
177   2. Reinstate the visited node hash table to avoid excess link hierarchy pollution.
178
179   In order to accomplish 1. it will be necessary to make the bookmark page renderer
180   a proper getter function, and one that never caches the contents of the buffer.
181
182   Actually, I might have to think about that a bit more.  I don't know
183   how to answer the question of what the best thing to do with node
184   parent links when using a cached node in place of a new node.  (Maybe
185   I always update node.parent unless parent is already an ancestor of
186   node?)
187
188   
189 ** CLOSED Support character encoding diversity
190
191 ** CLOSED Make URLs the basic address type.
192 Currently I waste a lot of effort converting between
193 URL and non-URL representations.  This is unnecessary, and
194 actually makes lots of things uglier.
195
196 For example, the bookmarks file contains addresses in Elpher's
197 internal representation, whereas I expect users would prefer
198 it contain URLs.
199
200 So the idea would be for (elpher-node-address node) to be
201 a either a string or a symbol, with symbols used for "special"
202 pages (bookmarks, start page, etc).  The getter functions
203 `elpher-address-selector' etc will still do what they currently
204 do, but will process the URL to do it.
205
206 This also means that non-gopher URLs will be explicitly represented
207 as such: no more abusing the "h" type for these.
208
209 ** INVALID Remove "redraw" command
210 This is only necessary for returning from displaying the raw
211 server response.  If I can provide a better way of doing that
212 then we can get rid of redraw entirely.
213
214 Actually, this command can be useful to correct rendering issues that
215 occasionally pop up in termal windows.  Lets leave it for now.
216
217 ** CLOSED Implement Finger support
218    
219 ** CLOSED Improve download performance
220    This is actually easy to fix - the major problem at the moment is
221    the braindead way the incrementally-retrieved data is recorded:
222    (setq result-string (concat result-string next-bit)).
223    This is O(N^2).  Yuck!
224    
225    Okay, replacing this really does improve things.  Large gemini
226    downloads now seem occur at rates I'd expect.
227    
228 ** CLOSED Download/rendering progress feedback
229    Particularly for large files or complicated pages, elpher can
230    take a few seconds or more to generate a response.  Thhis is
231    frustrating for users, who are left staring at a blinking
232    cursor.
233
234    A small amount of feedback could help with this.
235
236 ** CLOSED Implement Gemini support [100%]
237    :LOGBOOK:
238    - State "CLOSED"     from "OPEN"       [2020-06-20 Sat 22:32]
239    :END:
240    
241 Here is the checklist of features required before release:
242 - [X] basic genimi transactions
243 - [X] gemini transactions requiring client certificates
244 - [X] gemini input handling
245 - [X] gemini map files (text/gemini)
246 - [X] Support for plain text responses (text/*)
247 - [X] Support for image responses (text/image)
248 - [X] Support for mime-specified character encodeing
249 - [X] Saving responses to disk
250 - [X] Viewing raw responses
251   
252 The last few will be made infinitely easier if we factor the
253 gopher "getter" code differently.
254
255
256 ** INVALID Allow for grouping of bookmarks
257 :LOGBOOK:
258 - State "INVALID"    from              [2021-07-23 Fri 10:10] \\
259   Since switching to Emacs native bookmarks, this is no longer our concern.
260 :END:
261 To support this I'd like to add a bookmark page specific
262 set of keybindings.  Currently all bindings available on
263 the bookmark page are available everywhere else.  But
264 expanding and collapsing bookmark groups sounds like it
265 might need more specific bindings.
266
267 *** Priority bump <2020-05-31 Sun>
268
269 As bookmark lists grow, some sort of grouping is becoming more and more
270 important.  Furthermore, with this in place it would become feasible
271 (and I really suspect almost trivial) to implement an update-checking
272 system for chosen groups of bookmarks.
273
274 For instance, we could prefetch content for each of the addresses within
275 a chosen group, indicating which had been changed since the last fetch.
276 (We could just store hashes of earlier content to detect changes.)
277
278 The difficult thing to decide is how the UI for the new bookmark page
279 will work.  It already has its own renderer, and we could easily stop
280 using the gopher directory line renderer in favour of something more
281 amenable to displaying the group information.  Thus we're very free to
282 do whatever we like once we also have a special key map in place as well.
283
284 I guess I need to look into what native widgets Emacs has for displaying
285 collapsable hierarchies.
286
287
288 ** CLOSED Add history browsing
289 :LOGBOOK:
290 - State "CLOSED"     from "OPEN"       [2021-07-23 Fri 10:09]
291 :END:
292
293 ** CLOSED Improve gemeini rendering speed
294 :LOGBOOK:
295 - State "CLOSED"     from "OPEN"       [2021-07-31 Sat 00:18]
296 :END:
297
298 Currently pages with many links render extremely slowly.
299
300 Example (>2000 links, 15s): gemini://rawtext.club/~sloum/geminilist/
301
302 It turns out that by far the main contributor to this is the use of
303 (url-port) in elpher-address-from-gemini-url.  I encountered this
304 problem once before in elpher-remove-redundant-ports.  This function
305 call is just incredibly slow for some bizarre reason.  Happily,
306 (url-portspec) is functionally equivalent and is orders of magnitude
307 faster.  With this replacement, loading the above page takes ~2s
308 and there aren't any other hotspots.
309
310
311 ** CLOSED Replace support for user-specified starting pages
312 :LOGBOOK:
313 - State "CLOSED"     from "OPEN"       [2021-08-09 Mon 17:46]
314 :END:
315 This used to be available, but was removed during a refactor.