Loading ...
Sorry, an error occurred while loading the content.

New Message: Re: Verification of backup failed because the backed up text of post number 934 is not correct.

Expand Messages
  • notify@userland.com
    A new message was posted: Address: http://radio.userland.com/discuss/msgReader$30094 By: David Phillips (tweezerman@mindspring.com) When Radio makes a backup,
    Message 1 of 13 , Feb 1, 2004
    • 0 Attachment
      A new message was posted:

      Address: http://radio.userland.com/discuss/msgReader$30094

      By: David Phillips (tweezerman@...)



      When Radio makes a backup, the backup data (your posts) is encoded so it is valid XML.
      In system.verbs.builtins.radio.backup.backupOneMonth:

      add ("<title>" + encode (adrblog^.prefs.title) + "</title>");

      add ("<link>" + encode (radio.weblog.getUrl (adrblog)) + "</link>");

      add ("<description>" + encode (adrblog^.prefs.description) + "</description>")

      "encode" in the above code does this:

      on encode (s) {

      if system.environment.isMac { //02/22/2001 JES: convert to Latin text

      return (xml.entityEncode (latinToMac.macToLatin (string (s)), true))}

      else {

      return (xml.entityEncode (string (s), true))}}

      What characters get encoded by xml.entityEncode? Lots:

      1. Ampersand (&)

      2. Less than sign (<)

      3. Greater than sign (>)

      4. Quotation mark (")

      5. Apostrophe (')

      6. All characters with an ASCII code greater than or equal to 128. You'll
      have to look at a character map to see what all characters are covered by this,
      but this does include smart quotes as well as em and en dashes.

      The backup error occurs because when Radio verifies the backup, the backup data
      (which is now XML encoded) is being compared to the original post data (which is
      not XML encoded).
      From system.verbs.builtins.radio.backup.verifyOneMonth:

      bundle { //set text and backuptext -- we don't care about line endings or leading/trailing whitespace

      backuptext = string.trimWhiteSpace (string.replaceAll (string (adrbkp^.text), "\r\n", "\r"));

      text = string.trimWhiteSpace (string.replaceAll (string (adr^.text), "\r\n", "\r"))}

      if text != backuptext {

      error ("the backed up text of post number " + postnum + " is not correct.");

      return (false)}

      The backup data should be decoded with xml.entityDecode before comparing it
      to the original posts

      David Phillips (TweezerMan)

      The Tweezer's Edge v3 [1]

      [1] http://tweezersedge.com/

      This is a Manila site.. http://manila.userland.com/.
    • notify@userland.com
      A new message was posted: Address: http://radio.userland.com/discuss/msgReader$30100 By: Lawrence Lee (lawrence@userland.com) Thanks David, I ll post your
      Message 2 of 13 , Feb 1, 2004
      • 0 Attachment
        A new message was posted:

        Address: http://radio.userland.com/discuss/msgReader$30100

        By: Lawrence Lee (lawrence@...)

        Thanks David, I'll post your report to the bug tracking database for this issue.

        Lawrence

        This is a Manila site.. http://manila.userland.com/.
      • notify@userland.com
        A new message was posted: Address: http://radio.userland.com/discuss/msgReader$30105 By: Steve Hooker (steve@cybersaps.com) Cheers fpr reminding me of
        Message 3 of 13 , Feb 2, 2004
        • 0 Attachment
          A new message was posted:

          Address: http://radio.userland.com/discuss/msgReader$30105

          By: Steve Hooker (steve@...)

          Cheers fpr reminding me of xml.entityEncode Mr TweezerMan, you is the dude ;-)

          I tried just xml.entityEncode'ing the original text, but still found the error, though I'd love to dig deeper, I found that encoding both worked! For the first time, ever, I think, I finally get *error free verification* of all months.

          backuptext = xml.entityEncode (string.trimWhiteSpace (string.replaceAll (string (adrbkp^.text), "\r\n", "\r")));

          text = xml.entityEncode (string.trimWhiteSpace (string.replaceAll (string (adr^.text), "\r\n", "\r")))

          So, Madeline, if you want to correct your errors, you'll need to correct the code ;-) This verb is in Userlands section of the Radio root, so it may (probably will) be overwritten when they fix the bug. Go to the verb
          system.verbs.builtins.radio.backup.verifyOneMonth Look for the bundle /bundle //set text and backuptext/
          Put the verb xml.entityEncode () as marked above. Don't forget to compile.

          Don't want to do that? Then I've exported my copy, (save target to disk, and open from within Radio.)

          Steve Hooker

          http://www.cybersaps.org/

          This is a Manila site.. http://manila.userland.com/.
        • notify@userland.com
          A new message was posted: Address: http://radio.userland.com/discuss/msgReader$30106 By: Madeline Althoff (moonlet@garlic.com) OK, I think I ve done it...it
          Message 4 of 13 , Feb 2, 2004
          • 0 Attachment
            A new message was posted:

            Address: http://radio.userland.com/discuss/msgReader$30106

            By: Madeline Althoff (moonlet@...)

            OK, I think I've done it...it asked me if I wanted to replace the current copy of "backup.verifyOneMonth", and I said yes, then I pressed "Compile", then I saved...

            Regarding the change being overwritten by Userland's update, I fixed another thing in Radio's root, the fact that it (so very annoyingly!!) prepends your name to your category titles, and the guy who told how to do that also warned of this...but I don't really understand. Am I to understand that whenever there is an update of Radio's root, the entire code is replaced, so any changes one has made are eliminated? So what do you mean when you say that it will be overwritten "when they fix the bug"? If they fix this bug, then why would I care if what I did is overwritten? I only care if it's overwritten if they *don't* fix the bug and then the code returns to the way it was...right? What am I not understanding here?

            Thanks so much!!!

            This is a Manila site.. http://manila.userland.com/.
          • notify@userland.com
            A new message was posted: Address: http://radio.userland.com/discuss/msgReader$30123 By: Madeline Althoff (moonlet@garlic.com) I still got the error tonight...
            Message 5 of 13 , Feb 3, 2004
            • 0 Attachment
              A new message was posted:

              Address: http://radio.userland.com/discuss/msgReader$30123

              By: Madeline Althoff (moonlet@...)

              I still got the error tonight... :(

              This is a Manila site.. http://manila.userland.com/.
            • notify@userland.com
              A new message was posted: Address: http://radio.userland.com/discuss/msgReader$30138 By: Steve Hooker (steve@cybersaps.com) Did you! Hmmm... back to the
              Message 6 of 13 , Feb 3, 2004
              • 0 Attachment
                A new message was posted:

                Address: http://radio.userland.com/discuss/msgReader$30138

                By: Steve Hooker (steve@...)

                Did you! Hmmm... back to the drawing board then. Of late, I haven't left my copy of Radio running long enough for it to do any back ups or verification, perhaps.

                Let me just explain the overwriting thing. The idea with Frontier, and it's slightly cut down (but different) sister, Radio is that you can get at 90% of the code. By tradition, rather design, the system table in the main Radio root is Userland's with do not touch written all over it. If you do, updates may overwrite your changes. Your bug fix my indeed be fixed and over written, or your bug fix, maybe overwritten with new code but no fix, thus wiping your fix.

                The user table is ours. Nothing will ever be written to that, ever. So, the correct way to do it, or rather the old way was to copy a script from system.verbs.builtins.html.data.standardMacros � which once contained just about all you would want to change, copy it out and place it into user.html.macros. By doing this, your call to say imageRef or biggerFont would call the script in your user.html.macros rather than the main one in system.verbs.builtins.html.data.standardMacros

                They were the old days. Now, copying something deeper nested, like in system.verbs.builtins.radio out to user.html.macros won't work. Because the scripts are called precisely and are tangled so much that 5, 10 or even 20 scripts would need to be rewritten, repointed to your versions. Do-able but messy.

                For these small errors, embellishments, bug fixes that you and I want to do, we have to dive in change it, and await an overwrite one day in the future.

                To cover my arse :-) Any scripts I change, I always comment and control 4 to leave the date and my name. Then, I duplicate the script so that I have a back up. Usually in the same place (not fool proof, because Userland my overwrite the whole table, though usually, small incremental updates don't do this.)

                OK that's Radio. It's just me. Playing around usually. Frontier is different. I've lots of people relying on my versions of Frontier, I don't want updates overwriting my stuff, else all hell could break loose. What do I do? Well, one thing, I only update roots, when I'm good and ready. So auto updates are off.

                And, I use the little known feature called: user.rootUpdates.protectedChanges I put a ref to all my changes in there. If, more usually when, Userland wants to stomp on my changes I catch their version there. Compare their's to mine, merge and send out all the merges to all the servers I maintain.

                If you want, you can = "http://www.cybersaps.org/gems/rootUpdates.update.ftsc"download my version of the rootUpdates.update, it will work just as well for Radio, though I haven't tested it till 3 weeks in the future (I'm just installing it now). However, it's not mine. It's from = "http://www.baylys.com:8080/Patches/system/verbs/builtins/rootUpdates/update"D Bayly, who I used to work with. We've both been using it for... Over three years.

                For sure root updates are now big projects, where as they were automated every night. But, this way we can keep an eye on things and are usually not the first to spot mistakes in newly released code :-)

                Steve Hooker

                http://www.cybersaps.org/

                PS: I'll try and get some time later in the week to dig into this back up validation stuff.

                This is a Manila site.. http://manila.userland.com/.
              Your message has been successfully submitted and would be delivered to recipients shortly.