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

Direct stickynote data insertion into DB #242

Open
grootmax opened this issue Feb 19, 2024 · 12 comments
Open

Direct stickynote data insertion into DB #242

grootmax opened this issue Feb 19, 2024 · 12 comments

Comments

@grootmax
Copy link

We have analysed and created a new way of creating a stickynote in ourboard to manage overlapping of stickynote and to create stickynote with containers, but there is an issue, where websocket connection drops and not updating the frontend, and we directly create stickynote in db itself. Is this issue related to websocket

@raimohanska
Copy link
Owner

Dear sir,

I need you to be more specific here. Could you describe this New Way of Creating Sticky Notes?

Also, if you're using the server at ourboard.io, I might be able to have a look at server logs to see if there's anything interesting there. For this though, I'd need to know you board ID (in case you don't want to paste it here, you can send a link to firstname dot lastname at gmail dot com). If your hosting your own server, you can check the server logs yourself. Client logs may also reveal some details on the problem?

Now, I strongly advice against inserting anything directly to the DB, as the server will be unaware of these inserts and you may end up with a corrupted board state. OTOH, there APIs described in the README might be useful.

Now that's all I can do for you based on your problem description. With all respect, you need to be way more specific when creating an Issue.

Best Regards,
Juha

@raimohanska
Copy link
Owner

Just lately there was an issue on Ourboard related to private boards, and it resulted in the server closing the connection. This issue should be fixed by now, so just Trying Again might also help. Have a great day!

@grootmax
Copy link
Author

I am adding explanations here sir,

We read the data that is created for board events in db and created exact data and inserted to the db to create a stickynote without depending containers, everything is working fine, we controlled overlapping and sticky note is getting created without any issues just the creation part is fine.

The issue, for example if we create 15 sticky note at a time in db, it is getting created normally but sometimes 1 in 100 chances, it is not reflecting properly

The sticky note creation through the api provided is dependent on container and few params couldn't be passed

What do you suggest, creating separate api for stickynote creation, or editing existing api to our requirements or just a page refresh could do

Do you need further details, kindly share any other medium if possible

@raimohanska
Copy link
Owner

Sorry for the delay! My suggestion is that you make whatever API improvements you need and submit a Pull Request here. I'll give you feedback and then we can Merge it once it's good to go. 👍

@raimohanska
Copy link
Owner

More specifically the POST Item endpoint https://github.com/raimohanska/ourboard?tab=readme-ov-file#post-apiv1boardboardiditem could be improved to also accept, for instance, position parameters instead of a container. I mean, it could be such that it requires either

  • contains, in which case it works as currently
  • x, y in which case it places the item on the board at given position

@raimohanska
Copy link
Owner

It would be awesome to have automatic tests for any changed API endpoints. I've been thinking about including API tests in the Playwright test suite - so that some Playwright tests may combine testing with browser and API. For instance so that you insert this sticky using the API and then verify that it will appear in the browser.

@raimohanska
Copy link
Owner

Sorry for the ironic "dear sir" tone in my initial reply - that was perhaps not in the best of taste.

@raimohanska
Copy link
Owner

FYI, automatic tests for the API were added in #247. Some bugs were fixed on the way as well.

No substantial changes to the APIs yet though.

Did I understand correctly that you would prefer having API for adding and updating items without having to use a container id? Like,

PUT /board/1/item

{ type: "note", text: "hello", x: 400, y: 200, color: "#000000# }

@grootmax
Copy link
Author

sorry for the long delay,

  1. regarding creating and updating items, with-out container.
    yes, you understood it right.
    { type: "note", text: "hello", x: 400, y: 200, color: "#000000# }, can we also add (shape, width, height, and fontSize).
    need to make changes in ourboard/backend/src/api/utils.ts and ourboard/common/src/domain.ts

  2. can we have an API for deleting a board
    By utilizing inTransaction, we can have a board deletion right.
    with boardid being common, we can delete the content(event <-> api <-> board)

  3. can we have a state-saving feature for the owner of the board, similar to a clone board and private board.

Thank you for ourboard.

@raimohanska
Copy link
Owner

All of the above is doable for sure, but will get done best if you do it yourself in a Pull Request.

This is a hobby project for me so I don’t make promises for new features. I’m also currently still finalizing the collaborative text edit features so will not start working on other stuff any day soon.

Did not fully get what state saving would mean.

Maybe submit each feature request as a separate, accurately described Issue?

@grootmax
Copy link
Author

lately, I have been caught up with lots of work, will do the merge pull after modifying the code

@raimohanska
Copy link
Owner

Awesome! Looking forward. Some general criteria for acceptance from the top of my head:

  • No breaking changes for existing API users (partly covered by automated tests now)
  • All tests passing
  • New test cases (Playwright) for added functionality

We should probably write these down in some contribution guidelines at some point.

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