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