Opened 6 years ago

Closed 6 years ago

#1000 closed defect (fixed)

subscriptions.txt edited in webinterface won't save last line unless a newline is appended

Reported by: wasntme Owned by:
Priority: blocker Milestone: 0.9.8
Component: api/utils Version:
Keywords: subscriptions addressbook newline Cc: zab
Parent Tickets:


I2P version:
Java version: Oracle Corporation 1.7.0_21 (OpenJDK Runtime Environment 1.7.0_21-b02)
Wrapper version: 3.5.19
Server version: 7.6.11.v20130520
Servlet version: Jasper JSP 2.1 Engine
Platform: Linux amd64 3.2.0-4-amd64
Processor: Athlon 64 (unknown) (athlon64)
Jbigi: Locally optimized native BigInteger? library loaded from file
Encoding: UTF-8
Charset: UTF-8

Hi there,
I noticed some odd behavior, one of my subscriptions was always disappearing a while after adding. With some help I found out that it was missing a newline at the end and thus not written to the disk.

It appears to be correct in but counter checking on the disk will show that the last entry (not terminated by a newline) is missing.
Trying to save again, this time with newline appended, it appears on the disk immediately.


Change History (4)

comment:1 Changed 6 years ago by guest

Duplicated. Also on debian build.

comment:2 Changed 6 years ago by zzz

  • Cc zab added
  • Component changed from apps/addressbook to api/utils
  • Priority changed from minor to blocker

Nice. Happy 1000.

Appears that the bug is in DataHelper?.readLine() line 1307, should be

return i > 0
c != 1;

Unless for some reason we want it to throw out an unterminated line.

To be analyzed / reviewed / tested to make sure this isn't the intended behavior and doesn't break anything else. And identify what else this may fix.

Still minor but bumping to blocker so we get this into the next release.

comment:3 Changed 6 years ago by zzz

there was an \|\| in the return line above but the markdown ate it

comment:4 Changed 6 years ago by zzz

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in 3db4ea17e0fefd33d5cb246b83b4dc891badcfd5

Note: See TracTickets for help on using tickets.