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

Can't access new or updated route while on dev option #439

Closed
ibnubay opened this issue Mar 8, 2023 · 9 comments · Fixed by #446
Closed

Can't access new or updated route while on dev option #439

ibnubay opened this issue Mar 8, 2023 · 9 comments · Fixed by #446
Assignees
Labels
bug Something isn't working

Comments

@ibnubay
Copy link

ibnubay commented Mar 8, 2023

Bug Description

Dev option for hot reloading is not working to recompile python code into rust object

Steps to Reproduce

  1. Start simple app.py, python app.py --dev
from robyn import Robyn

app = Robyn(__file__)


@app.get("/")
async def hello(request):
    return "Hello World"


app.start(port=8080)
  1. Update return value of hello function, or add new route
    DEBUG:fsevents:NativeEvent(path="/pp.py", inode=30320742, flags=11400, id=285275140): is_file, is_inode_meta_mod, is_modified
    DEBUG:fsevents:NativeEvent(path="web_api/app.py~", inode=30678452, flags=15700, id=285275143): is_coalesced, is_created, is_file, is_inode_meta_mod, is_modified, is_owner_change, is_removed
    DEBUG:fsevents:queue_event <FileModifiedEvent: event_type=modified, src_path='web_api/app.py', is_directory=False>
    DEBUG:fsevents:queue_event <FileCreatedEvent: event_type=created, src_path='web_api/app.py~', is_directory=False>
    DEBUG:fsevents:queue_event <DirModifiedEvent: event_type=modified, src_path='web_api', is_directory=True>
    DEBUG:fsevents:queue_event <FileModifiedEvent: event_type=modified, src_path='web_api/app.py~', is_directory=False>
    DEBUG:fsevents:queue_event <FileDeletedEvent: event_type=deleted, src_path='web_api/app.py~', is_directory=False>
    DEBUG:fsevents:queue_event <DirModifiedEvent: event_type=modified, src_path='web_api', is_directory=True>

  2. But when rehit GET root path, still return old value or new route is not available

Your operating system

on macbook intel, mac os monterey

Your Python version (python --version)

3.10.9

Your Robyn version

0.25.0

Additional Info

No response

@ibnubay ibnubay added the bug Something isn't working label Mar 8, 2023
@Noborita9
Copy link
Contributor

Just wondering, at the app = Robyn(File)
Is it exactly that?

@Noborita9
Copy link
Contributor

Nevermind, I tested it myself and it's happening. Not sure if this is new, I remember that it was working, That or my memory is going to get nervous 😰

@sansyrox
Copy link
Member

sansyrox commented Mar 8, 2023

@ibnbay99 , thank you for opening the issue. This is really strange. I will have a look

@ibnubay
Copy link
Author

ibnubay commented Mar 9, 2023

@Noborita9 , I'm forgot to block my code with code block.... updated my first comment

@AntoineRR
Copy link
Collaborator

@sansyrox I was able to reproduce the bug, and I think it is linked with how we handle hot reloading currently. We do not populate the router and middleware router again but still use their old values.
I can work on this if you want as I previously reworked the dev flag already.

@sansyrox
Copy link
Member

sansyrox commented Mar 9, 2023

@AntoineRR , thank you! That sounds good to me 😊😊

@AntoineRR
Copy link
Collaborator

Ok I'll take this subject then 😉

@AntoineRR AntoineRR self-assigned this Mar 9, 2023
@sansyrox
Copy link
Member

sansyrox commented Mar 9, 2023

@AntoineRR , I was thinking we should introduce some smoke testing for issues like this. I will be happy to write some to help with the PR.

What say?

@AntoineRR
Copy link
Collaborator

Sound good to me! I'm not sure how to write such tests for now so your help is welcome 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants