Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot call express-xml on feeds with no items #9

Closed
sidibu opened this issue Apr 8, 2022 · 7 comments
Closed

Cannot call express-xml on feeds with no items #9

sidibu opened this issue Apr 8, 2022 · 7 comments

Comments

@sidibu
Copy link

sidibu commented Apr 8, 2022

Hello,

trying to run the following example

#lang racket
(require splitflap)

(define my-feed
 (feed (mint-tag-uri "example.com" "2022" "Test")
       "http://example.com"
       "Test Feed"
        empty))

(express-xml my-feed 'rss "http://example.com")

leads to the error

car: contract violation
  expected: pair?
  given: '()
  context...:
   body of "/home/user/splitflap-bug.rkt"

When my-feed contains at least one feed-item the above error does not occur.

Is this behaviour intentional? How can I build the xml of empty feeds?

@otherjoel
Copy link
Owner

Thanks for the report. Building XML for empty feeds isn’t something I’ve tried or tested, but obviously it should be possible! I’ll fix shortly.

@otherjoel
Copy link
Owner

Should be fixed now. Note that the feed’s publish/last updated timestamp elements will default to “now” if there are no entries.

@otherjoel otherjoel reopened this Apr 8, 2022
@sidibu
Copy link
Author

sidibu commented Apr 10, 2022

Thank you for the fast fixing! Do you know when the racket packge list will be updated so I can update to the new splitflap version?

@otherjoel
Copy link
Owner

otherjoel commented Apr 11, 2022

Sorry — I was traveling yesterday. Assuming you installed with raco pkg install splitflap, you should be able to run raco pkg update splitflap and get the update right away. When you first install, raco uses the package catalog to determine where the package lives, but it fetches the package itself and any subsequent updates directly from the package source. [Incorrect; the package catalog server is consulted for updates as well.]

@sidibu
Copy link
Author

sidibu commented Apr 12, 2022

I installed with raco pkg install splitflap. Running raco pkg update splitflap gives the following output:

Resolving "splitflap" via https://download.racket-lang.org/releases/8.4/catalog/
Resolving "splitflap" via https://pkgs.racket-lang.org
Resolving "splitflap-doc" via https://download.racket-lang.org/releases/8.4/catalog/
Resolving "splitflap-doc" via https://pkgs.racket-lang.org
Resolving "splitflap-lib" via https://download.racket-lang.org/releases/8.4/catalog/
Resolving "splitflap-lib" via https://pkgs.racket-lang.org
No updates available

Running raco pkg show splitflap gives:

Installation-wide:
 [none]
User-specific for installation "8.4":
 Package    Checksum                Source
 splitflap  2a20e28530243c4b228...  catalog...litflap#main

Looking up splitflap at the racket package list at https://pkgs.racket-lang.org/package/splitflap shows that the package was last checked at the 8th April.

When I run the example of this issue with no feed-items again, the error persists.

Looking at the local installed splitflap sources the commits for version 1.2 are not contained.

Could it be that the racket package list is not updated for this library?

@otherjoel
Copy link
Owner

Apparently there was some issue with the package server (in addition to me having misconceptions about how end users see package updates). Can you try updating again and see if it works this time?

@sidibu
Copy link
Author

sidibu commented Apr 13, 2022

Thank you! I got the update and it is working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants